keisoku

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.

terms

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 kApproximationErrorCorrect digits
03.1415927300137.64e-87
13.1415926535906.40e-1615
23.1415926535905.68e-2423

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

  1. Home
  2. Ramanujan Pi Formula Calculator