Code Monkey home page Code Monkey logo

iterations-counting's Introduction

Iterations counting

Introduction

Counting series functions is intersting problem for IT. Common problem for this algorithm is optimization. This program realise 3 series functions: power function, arctg, arsinh. This functions used in physics, math and some of IT areas.

Problem analysis

Task: counting infinity series with fixed approximation. All functions must work with rational numbers. Written in c std99. Program not using math.h library.

Solution draft

Helper functions:

Square root

equation

Using Newtone's method.

Natural logarithm

equation

equation

equation

equation

equation

equation

equation

Signification digit

Used to get fixed approximation:

equation

Solution

Power function

equation

equation

equation

equation

equation

equation

equation

Arctangent

equation

equation

equation

equation

equation

equation

Hyperbolic arcsine

equation

equation

equation

Program

Compilation
gcc -std=c99 -pedantic -Wall -Wextra main.c -o ./iterations

or just

make

Usage

print all parameters:

./iterations --help 

also use this parameters:

-h				print help
--help
--powxa			count exponntial function
--arctg			count arctangens function
--argsinh		count argument of sinus hyperbolic function
[0...]			signification digits
[real number]	exponetial function parameter

example:

 ./iterations --powxa 7 2.45

program will count exponential function x^2.45 with 7 digits of approximation

Input is stdin line.


Note: Program using 20 digit constant for e and pi. Currently 20 digits is maximum, but add this contants series counting is to-do.


LICENSE

CC SA

iterations-counting's People

Contributors

kusha avatar mbirger-rh avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.