Ramanujan Pi Formula Calculator
Approximate pi with Ramanujan's rapidly converging series. Choose how many terms to add and see the approximation, the error against true pi, the correct digit count, and a term-by-term convergence table.
Input
Approximate pi with Ramanujan''s rapidly converging formula. Enter how many terms to add and get the approximation, the error against true pi, and the number of correct digits.
One term gives about 8 digits, and each extra term adds about 8 more correct digits. You can enter 1 to 20.
Result
Pi approximation from 3 terms
3.1415926535897932384626490
Terms
3
Correct digits
about 23
Error vs true pi
5.682e-24
Term-by-term convergence
Term index k starts at 0. Each row shows the approximation, error, and correct digits after that term is added.
| Term k | Approximation | Error | Correct digits |
|---|---|---|---|
| 0 | 3.141592730013 | 7.64e-8 | 7 |
| 1 | 3.141592653590 | 6.40e-16 | 15 |
| 2 | 3.141592653590 | 5.68e-24 | 23 |
1/pi = (2 times the square root of 2 over 9801) times the sum of factorial of 4k times 1103 plus 26390k over the fourth power of k factorial times 396 to the 4k. Computed with high precision integer arithmetic to avoid loss of precision.
How it works
- The formula writes 1/pi as the product of 2 times the square root of 2 over 9801 and an infinite series whose terms use the factorial of 4k times 1103 plus 26390k over the fourth power of k factorial times 396 raised to 4k.
- Just one term gives about 8 correct digits and two terms about 16, so each added term increases the number of correct digits by roughly eight.
- To avoid loss of precision, this tool evaluates the series and the square root with high precision fixed point integer arithmetic internally.
- The error is measured against a separate high precision reference value of pi, and the correct digit estimate is derived from the size of that error.
- Adding too many terms greatly increases the work, so the number of terms you can enter is capped.
Reviews
Tell us what you think of this calculator.
Write a review
- Home
Ramanujan Pi Formula Calculator