Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Arithmetic-Geometric Mean AGM(a, b)
13.45817148172562
converged limit of the two means
Iterations used 5
Method Gauss arithmetic-geometric mean

What is the Arithmetic-Geometric Mean?

The arithmetic-geometric mean, written AGM(a, b), is a famous construction studied by Gauss. Starting from two non-negative numbers a and b, you repeatedly replace the pair with its arithmetic mean and its geometric mean. Both new sequences squeeze toward a single common value — that shared limit is the AGM. This is pure mathematics and applies identically everywhere; the inputs are dimensionless numbers with no units.

How to use this calculator

Enter a value for a and a value for b (both should be zero or positive). The maximum loop count n caps the number of iterations — the default of 100 is far more than needed, since double-precision convergence usually happens in 5 or 6 steps. The calculator returns AGM(a, b) plus the number of iterations actually performed before the two sequences matched at working precision.

The formula explained

Set \(a_0 = a\) and \(b_0 = b\). Then iterate:

$$a_{k+1} = \frac{a_k + b_k}{2}$$ (the arithmetic mean), and $$b_{k+1} = \sqrt{a_k \cdot b_k}$$ (the geometric mean).

Because the arithmetic mean is always at least the geometric mean, the a-terms decrease while the b-terms increase, trapping the limit between them. Convergence is quadratic — the number of correct digits roughly doubles each step.

Advertisement
Two sequences converging from above and below to a single AGM value
The arithmetic sequence decreases and the geometric sequence increases until both meet at AGM(a, b).

Worked example: AGM(24, 6)

\(a_0 = 24\), \(b_0 = 6\). Step 1: $$a_1 = \frac{24 + 6}{2} = 15, \qquad b_1 = \sqrt{24 \cdot 6} = \sqrt{144} = 12$$ Step 2: $$a_2 = 13.5, \qquad b_2 = \sqrt{180} \approx 13.41640786$$ Step 3: \(a_3 \approx 13.45820393\), \(b_3 \approx 13.45820352\). Within a couple more steps both settle on \(\text{AGM}(24, 6) \approx 13.45820372613015\).

Diagram of one AGM iteration computing the new average and geometric mean
Each step replaces (a, b) with their arithmetic mean and geometric mean.

FAQ

What if a equals b? The sequences are constant, so \(\text{AGM}(a, a) = a\) immediately, for example \(\text{AGM}(5, 5) = 5\).

What if one value is 0? The geometric mean becomes \(\sqrt{0} = 0\) and stays 0, so \(\text{AGM}(a, 0) = \text{AGM}(0, b) = 0\).

Can I use negative numbers? No. A negative product makes the square root undefined over the reals, so this tool requires \(a \ge 0\) and \(b \ge 0\).

Last updated: