Connect via MCP →

Enter Calculation

Formula

Formula: Pi Calculation by Arithmetic-Geometric Mean (AGM)
Show calculation steps (1)
  1. Borwein quartic iteration

    Borwein quartic iteration: Pi Calculation by Arithmetic-Geometric Mean (AGM)

    Start y0=sqrt(2)-1, a0=6-4 sqrt(2). Quadruples correct digits per iteration; pi = 1/a_n.

Advertisement

Results

Computed value of pi
3.141592653589794
pure dimensionless constant
Iterations used 4
Last step change (delta) 0E0
Displayed significant digits 15 (double-precision cap)

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.

Three error-decreasing curves comparing quadratic, quartic and nonic convergence speeds
Higher-order AGM schemes multiply the number of correct digits each iteration.
Two sequences a and b converging toward a common value through AGM iteration
The arithmetic and geometric means converge rapidly to a common limit, the AGM.

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.

Last updated: