This is a package that computes the pi number using various approaches. The codes are implemented by Muhammad Hammad and Sharareh Sayyad.
To run all tests, use sh script_test_piapprox.sh
or make the bash script executable using chmod+x script_test_piapprox.sh
To run all implementations, use sh create_modules.sh
Demonstration of the methods and analyzing their performance is presented in a Jupyter notebook in the example
directory.
Our methods for evaluating polygons
, Monte Carlo algorithm
, the continued-fraction approach
, Ramanujan's formula
, Leibniz formula
, Chudnovsky formula
, Bailey–Borwein–Plouffe formula (BBP) fromula
, Gauss-Legendre algorithm
and Nilakantha series
. The implementation is in PIapprox directory.
-
Class for types of outputs
-
Class for approximations of pi
In summary, the project consists of the following components:
• Classes that approximate numbers.
• Methods that rely on these classes to approximate pi.
• An automated test suite forFloatNumber, RationalNumber and FixedPrecision.
• A Jupyter notebook that explains the methods and the comparison.