Arithmetic-Geometric Mean Calculator

Arithmetic-geometric mean1.19814
Iterations to converge4
How this was calculated
  1. Start with a0 = 1 and b0 = 1.41421; each step replaces the pair with its arithmetic mean and its geometric mean.
  2. The two sequences converge to the same limit: AGM = 1.19814 after 4 iterations.
  3. As a check, the limit lies between the geometric mean 1.18921 and the arithmetic mean 1.20711 of the starting pair.

This arithmetic geometric mean calculator computes the AGM of any two non-negative numbers you enter. The arithmetic-geometric mean AGM(a, b) repeatedly replaces the pair (a, b) with ((a + b) / 2, sqrt(a x b)) until the two sequences converge to the same limit. Convergence is quadratic, so a handful of iterations suffices. For example, AGM(1, sqrt(2)) = 1.19814 after 4 iterations, and its reciprocal is Gauss's constant G = 0.83463. Likewise, AGM(2, 8) = 4.48606 after 5 iterations, a result that falls between the geometric mean 4.00000 and the arithmetic mean 5.00000, as the limit must be. The AGM always lies between those two means, and it satisfies AGM(a, b) = AGM(b, a) with AGM(ca, cb) = c x AGM(a, b).

The AGM is the accepted standard for fast, high-precision computation of elliptic integrals and related constants. Gauss discovered the AGM in 1799 while studying the lemniscate arc length; it also yields fast algorithms for pi (Brent-Salamin) and for elliptic integrals. With modulus k = 0.5, Gauss's identity K(k) = pi / (2 x AGM(1, sqrt(1 - k^2))) gives K(0.5) = 1.68575, using AGM(1, 0.86603) = 0.93181. This page shows the formula, step-by-step workings, worked examples, and sources so you can verify every result the calculator produces.

Worked examples

The lemniscate case

Primary result: 1.19814 — AGM(1, sqrt(2)), whose reciprocal is Gauss's constant. (AGM of two numbers · 1 · 1.414214)

Arithmetic-geometric mean1.19814
Iterations to converge4

Two integers

Primary result: 4.48606 — between the geometric mean 4.00000 and the arithmetic mean 5.00000, as it must be. (AGM of two numbers · 2 · 8)

Arithmetic-geometric mean4.48606
Iterations to converge5

Elliptic integral mode

Primary result: 1.68575 — K(0.5) from pi / (2 x AGM(1, sqrt(1 - 0.25))). (Complete elliptic integral K(k) · 0.5 · 0)

Complete elliptic integral K(k)1.68575
AGM(1, sqrt(1 - k^2))0.93181

What the arithmetic-geometric mean is

The arithmetic-geometric mean AGM(a, b) is built by repeatedly replacing the pair (a, b) with ((a + b) / 2, sqrt(a x b)) until the two sequences converge to the same limit. At each step, one value moves from the arithmetic mean toward the geometric mean, while the other moves from the geometric mean toward the arithmetic mean. They chase each other and lock onto a single number surprisingly fast, because convergence is quadratic, so a handful of iterations suffices.

The AGM always lies between the geometric and arithmetic means of the starting pair, and it behaves neatly under simple changes: AGM(a, b) = AGM(b, a), and AGM(ca, cb) = c x AGM(a, b). A quick check with AGM(2, 8) = 4.48606 after 5 iterations shows the principle in action, sitting between the geometric mean 4.00000 and the arithmetic mean 5.00000, exactly as the limit must. Our arithmetic geometric mean calculator applies these rules directly.

Gauss discovered the AGM in 1799 while studying the lemniscate arc length, a curve shaped like a figure eight. He realized that this converging pair of means opened a back door into elliptic integrals, which describe arc lengths and other quantities that ordinary geometry cannot handle. With modulus k = 0.5, Gauss's identity K(k) = pi / (2 x AGM(1, sqrt(1 - k^2))) gives K(0.5) = 1.68575, using AGM(1, 0.86603) = 0.93181.

A famous special case is AGM(1, sqrt(2)) = 1.19814 after 4 iterations; its reciprocal is Gauss's constant G = 0.83463. Beyond elliptic integrals, the AGM also yields fast algorithms for pi, including the Brent-Salamin method, which is why a concept from 1799 still matters in modern computation.

The iteration, step by step

The arithmetic-geometric mean AGM(a, b) repeatedly replaces the pair (a, b) with ((a + b) / 2, sqrt(a x b)) until the two sequences converge to the same limit. To see exactly how this works, consider AGM(2, 8). The arithmetic mean of 2 and 8 is (2 + 8) / 2 = 5, and the geometric mean is sqrt(2 x 8) = sqrt(16) = 4. So after the first iteration, the pair becomes (5, 4). The two values have already moved much closer together, and the process continues from there.

In the second iteration, the arithmetic mean of 5 and 4 is (5 + 4) / 2 = 4.5, and the geometric mean is sqrt(5 x 4) = sqrt(20) = 4.47214. The pair is now (4.5, 4.47214). Notice that the gap between the two numbers shrank dramatically — from a difference of 1 down to about 0.028. Each subsequent iteration tightens the pair further, and after 5 iterations the sequences converge to 4.48606. This limit sits squarely between the geometric mean 4.00000 and the arithmetic mean 5.00000 of the original pair, as it must.

The reason only 5 iterations suffice is that convergence is quadratic. In practical terms, each iteration roughly squares the number of correct digits — the error shrinks far faster than with ordinary iterative methods. A handful of iterations is enough for most starting values, which is why an arithmetic geometric mean calculator can return high-precision results almost instantly. This rapid convergence is the same property that makes the AGM central to fast algorithms for pi (Brent-Salamin) and for elliptic integrals, applications Gauss anticipated when he discovered the AGM in 1799 while studying the lemniscate arc length.

A useful check at each step is that the geometric mean always stays below the arithmetic mean, so the lower sequence rises and the upper sequence falls until they meet. The limit is always sandwiched between the two starting means, and the symmetry properties AGM(a, b) = AGM(b, a) and AGM(ca, cb) = c x AGM(a, b) let you simplify inputs before iterating.

Worked examples

The arithmetic geometric mean calculator above can verify results for a range of starting pairs and related elliptic integrals. Recall that the AGM repeatedly replaces the pair (a, b) with ((a + b) / 2, sqrt(a x b)) until the two sequences converge to the same limit. Because convergence is quadratic, a handful of iterations suffices for high precision, as the three verified cases below demonstrate.

The first example is a classic one. AGM(1, sqrt(2)) equals 1.19814 after 4 iterations. Its reciprocal is Gauss's constant G = 0.83463, a value Gauss discovered in 1799 while studying the lemniscate arc length. The second example, AGM(2, 8), equals 4.48606 after 5 iterations. This result sits between the geometric mean 4.00000 and the arithmetic mean 5.00000, as the limit must be, since the AGM always lies between those two starting means.

The third example illustrates the connection to elliptic integrals. With modulus k = 0.5, Gauss's identity K(k) = pi / (2 x AGM(1, sqrt(1 - k^2))) gives K(0.5) = 1.68575, using AGM(1, 0.86603) = 0.93181. The same property that makes this identity work, namely AGM(ca, cb) = c x AGM(a, b), also yields fast algorithms for pi (Brent-Salamin) and for elliptic integrals.

ComputationInputsResultIterations
AGM(1, sqrt(2))1, sqrt(2)1.198144
AGM(2, 8)2, 84.486065
K(0.5)k = 0.51.68575—

From AGM to the elliptic integral K(k)

Gauss discovered the arithmetic-geometric mean in 1799 while studying the lemniscate arc length, but the identity that gives the AGM lasting practical value is its connection to the complete elliptic integral of the first kind, K(k). Gauss's identity states that K(k) = pi / (2 x AGM(1, sqrt(1 - k^2))). Because the AGM converges quadratically, a handful of iterations suffices to compute K(k) to high precision. This makes an arithmetic geometric mean calculator a powerful tool for anyone working with elliptic integrals, since the AGM approach is far faster than evaluating the integral directly.

To see the identity in action, take modulus k = 0.5. First compute AGM(1, 0.86603), where 0.86603 is sqrt(1 - k^2). The AGM repeatedly replaces the pair (a, b) with ((a + b) / 2, sqrt(a x b)) until the two sequences converge to the same limit. Here the limit is 0.93181. Plugging into Gauss's formula gives K(0.5) = pi / (2 x 0.93181) = 1.68575. This verified result matches the known value of the elliptic integral at that modulus, confirming the identity works as a computational shortcut.

K(k) matters in physics and engineering because it appears in problems involving elliptical motion and special function design. The period of a simple pendulum, for instance, depends on K(k) when the swing angle is large enough that the small-angle approximation breaks down. Engineers also rely on K(k) in elliptic filter design, where it determines the ripple and cutoff characteristics that make these filters efficient for demanding signal-processing applications.

The AGM's computational efficiency extends beyond K(k). The same quadratic convergence that makes the elliptic integral calculation fast also underlies algorithms for computing pi, such as the Brent-Salamin method. The AGM always lies between the geometric and arithmetic means of the starting pair, and it satisfies the symmetry and scaling properties AGM(a, b) = AGM(b, a) and AGM(ca, cb) = c x AGM(a, b). These properties, combined with its speed, explain why Gauss's 1799 discovery remains relevant in modern numerical analysis.

AGM vs arithmetic, geometric and harmonic means

For any pair of positive numbers, four classical means sit in a fixed order: the harmonic mean is smallest, then the geometric mean, then the arithmetic-geometric mean, and finally the arithmetic mean is largest. Write this as HM <= GM <= AGM <= AM. The arithmetic-geometric mean always lands between the geometric and arithmetic means because of how it is built: AGM(a, b) repeatedly replaces the pair (a, b) with ((a + b) / 2, sqrt(a x b)) until the two sequences converge to the same limit. Since each step takes the arithmetic mean of the previous pair and the geometric mean of the previous pair, the limit cannot escape the interval between the two starting means.

The numbers 2 and 8 make the chain concrete. The harmonic mean is 3.2, the geometric mean is 4, the arithmetic-geometric mean is 4.48606, and the arithmetic mean is 5. An arithmetic geometric mean calculator confirms that AGM(2, 8) = 4.48606 after 5 iterations, which indeed falls between the geometric mean of 4.00000 and the arithmetic mean of 5.00000, as the limit must be. Convergence is quadratic, so a handful of iterations suffices to reach this result.

The AGM shares two symmetry properties with the other means: AGM(a, b) = AGM(b, a), and AGM(ca, cb) = c x AGM(a, b). This scaling property means the relative position of the AGM between the geometric and arithmetic means stays the same no matter how the starting pair is scaled. The harmonic mean sits below the geometric mean because it weights the smaller number more heavily, while the arithmetic mean sits above because it weights both numbers equally. The AGM splits the difference in a way that reflects both averages at once.

Gauss discovered the AGM in 1799 while studying the lemniscate arc length, and the connection to elliptic integrals is what makes the AGM more than a curiosity. With modulus k = 0.5, Gauss's identity K(k) = pi / (2 x AGM(1, sqrt(1 - k^2))) gives K(0.5) = 1.68575, using AGM(1, 0.86603) = 0.93181. The same property that places the AGM between the geometric and arithmetic means is what allows it to converge quickly enough to compute these integrals efficiently. The AGM also yields fast algorithms for pi, including the Brent-Salamin method, which relies on the same quadratic convergence that brings the two sequences together in just a few steps.

Where the AGM is used

Gauss discovered the AGM in 1799 while studying the lemniscate arc length, a curve shaped like a figure eight. The lemniscate constant, which describes the total arc length of this curve, is closely tied to the arithmetic-geometric mean. Because the AGM converges quadratically — meaning a handful of iterations suffices for high precision — it became a powerful tool for computing constants that arise in geometry and analysis.

One of the most famous applications is the Brent-Salamin algorithm for pi. This algorithm uses the arithmetic-geometric mean to produce digits of pi with remarkable speed. Each iteration roughly doubles the number of correct digits, which makes the method far faster than older approaches that add only a fixed number of digits per step. An arithmetic geometric mean calculator can demonstrate this efficiency by showing how quickly the two sequences converge.

In physics and engineering, the AGM provides fast ways to evaluate elliptic integrals, which appear in problems involving pendulums, planetary orbits, and electromagnetic fields. Gauss's identity links the complete elliptic integral K(k) directly to the AGM: with modulus k = 0.5, the formula K(k) = pi / (2 x AGM(1, sqrt(1 - k^2))) gives K(0.5) = 1.68575, using AGM(1, 0.86603) = 0.93181. This connection turns a difficult integral into a simple iterative process.

The same property that makes the AGM useful for elliptic integrals also makes it valuable for numerical software. Because the AGM always lies between the geometric and arithmetic means of the starting pair, and because AGM(ca, cb) = c x AGM(a, b), the method scales cleanly and stays stable across a wide range of inputs. These features explain why the AGM remains relevant in modern computational mathematics.

FAQs

How do you calculate the arithmetic-geometric mean?

Iterate the pair (a, b) by replacing it with ((a + b)/2, sqrt(ab)) on each step. Continue until both values agree to your desired precision. For example, AGM(2, 8) reaches 4.48606 in 5 iterations. The two sequences converge rapidly toward a common value, which is the arithmetic-geometric mean.

What is AGM(1, sqrt(2))?

AGM(1, sqrt(2)) equals 1.19814. Its reciprocal, 0.83463, is known as Gauss's constant. This value is tied to the lemniscate arc length, making it significant in mathematical analysis. The AGM provides an efficient way to compute this constant, which appears in various areas of number theory and elliptic function theory.

How many iterations does the AGM need?

Very few iterations are needed because AGM convergence is quadratic, meaning the number of correct digits roughly doubles each step. In verified cases, 4 iterations suffice for (1, 1.41421) and 5 iterations for (2, 8). This rapid convergence makes the AGM practical for high-precision numerical computation.

How is K(k) computed from the AGM?

The complete elliptic integral of the first kind is computed as K(k) = pi / (2 x AGM(1, sqrt(1 - k^2))). For k = 0.5, AGM(1, 0.86603) = 0.93181, yielding K = 1.68575. This formula allows efficient evaluation of elliptic integrals without numerical integration.

Is the AGM bigger than the geometric mean?

The AGM always lies between the geometric mean and the arithmetic mean. For 2 and 8, GM = 4.00000 < AGM = 4.48606 < AM = 5.00000. This inequality holds generally for positive inputs. The AGM starts with both means and iterates them together, so it naturally falls between the two original values.

What is the AGM used for?

The AGM is used for fast computation of elliptic integrals and pi through the Brent-Salamin algorithm. It also enables exact pendulum-period calculations via K(k). Its quadratic convergence makes it especially valuable for high-precision numerical work where speed and accuracy are both critical.

Sources

Related calculators

Harmonic Mean Calculator
The right average for rates and ratios — average speeds, price per unit, densities — with the geometric and arithmetic means shown so you can see why it differs.
Mean Median Mode Calculator
Mean, median, mode, range and sum for up to ten numbers — with the sorted list and the working shown, so the three 'averages' finally make sense.
Quadratic Mean (RMS) Calculator
The root mean square of up to eight values — the mean that squares first, used for AC voltages, errors and signal levels.