Arithmetic-Geometric Mean Calculator
Compute the arithmetic-geometric mean (AGM) of two positive numbers by iterating the arithmetic and geometric means to a shared limit.
How it works
Repeat aₙ₊₁ = (aₙ + bₙ) ÷ 2, bₙ₊₁ = √(aₙ · bₙ) · both converge to the AGM · GM ≤ AGM ≤ AM
The arithmetic-geometric mean is found by repeatedly replacing a pair of numbers with their arithmetic mean and their geometric mean; the two sequences squeeze together and meet at a common limit. Convergence is extremely fast — the number of correct digits roughly doubles each step — which is why the AGM underlies high-precision algorithms for π and the elliptic integrals. The limit always lies between the original geometric and arithmetic means.
Worked example
Starting from 24 and 6: the means are 15 and 12; then 13.5 and 13.4164…; then 13.4582… and 13.4582…. After a few steps both agree, giving an AGM of about 13.4582.
Frequently asked questions
What is the arithmetic-geometric mean?
It is the shared limit you reach by alternately taking the arithmetic mean (a+b)/2 and the geometric mean √(ab) of a pair of numbers. Because AM ≥ GM, the pair converges, and the AGM lands between the two.
Why does it converge so fast?
Each iteration roughly squares the closeness of the two numbers, so the count of accurate digits about doubles per step. Two positive inputs typically agree to double precision within four or five iterations.
What is the AGM used for?
It gives a remarkably efficient way to evaluate complete elliptic integrals and, through Gauss–Legendre-type algorithms, to compute π to millions of digits.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.