What this calculator does
This tool computes the mathematical constant pi using arithmetic-geometric mean (AGM) iteration schemes. AGM-based methods converge dramatically faster than classical series: each step of the quadratic Gauss-Legendre method roughly doubles the number of correct digits, the Borwein quartic method quadruples them, and the nonic variant multiplies them by nine. These are standard published numerical algorithms and work identically everywhere - this is pure mathematics with no units and no jurisdiction.
How to use it
Pick a Calculation formula (Quadratic Gauss-Legendre is the default and is sufficient for most purposes), choose the Number of digits you want, and optionally set a Max iterations cap (100 is generous - about 6 iterations already reach 50 digits). The calculator iterates until the estimate stops changing at the working precision, then reports the value of pi, how many iterations it used, and the size of the last step change.
The formula explained
The Gauss-Legendre (Salamin-Brent, 1976) scheme initializes \(a_0 = 1\), \(b_0 = 1/\sqrt{2}\), \(t_0 = 1/4\), \(p_0 = 1\). Each iteration sets the new arithmetic mean \(a\), the geometric mean \(b = \sqrt{a\cdot b}\), updates \(t\) by subtracting \(p\cdot(a - a_{\text{new}})^2\), and doubles \(p\). The current estimate is
$$\pi = \frac{(a + b)^2}{4\,t}.$$Because the arithmetic and geometric means converge quadratically toward a common AGM value, the error squares each step.
Worked example
Starting from the values above with the quadratic method: iteration 1 gives about \(3.140579\) (3 correct digits), iteration 2 gives \(3.14159264\) (8 digits), and iteration 3 gives \(3.141592653589793\) - the full precision available in IEEE double arithmetic. A fourth step produces no change, so the loop stops after 3 iterations.
FAQ
Why is the value capped at about 15 digits? This rebuild uses IEEE double-precision floating point, which carries roughly 15-16 significant digits. Higher digit counts in the dropdown indicate the target precision the underlying AGM scheme is capable of with arbitrary-precision arithmetic.
Do the three methods give different answers? No - they all converge to the same value of pi. They differ only in how fast they get there (iterations needed).
What is the last step change? It is the magnitude of the difference between the final two estimates, a quick gauge of how tightly the iteration has converged.