keisoku

Arithmetic-Geometric Mean (AGM) Calculator

Compute the arithmetic-geometric mean (AGM) of two positive numbers a and b by iterating the arithmetic and geometric means until they converge, with the full iteration table.

Input

Enter two positive numbers to iterate the arithmetic and geometric means until they converge and compute the arithmetic-geometric mean (AGM).

Both a and b must be positive numbers.

Result

AGM of 1 and 2

1.45679103

Arithmetic mean

1.5

Geometric mean

1.41421356

Iterations

4

Iteration steps

Each row shows the arithmetic mean, the geometric mean, and their difference per iteration. The closer the difference is to zero, the more it has converged.

StepArithmetic meanGeometric meanDifference
11.51.414213560.08578644
21.457106781.456475320.00063147
31.456791051.456791010.00000003
41.456791031.456791030

Each step computes a'' = (a + b) / 2 and b'' = the square root of ab. Since the arithmetic mean is always at least the geometric mean, the two values converge quadratically to a common limit.

How it works

  • The arithmetic-geometric mean of two numbers a and b is the common limit reached by repeatedly replacing them with their arithmetic mean (a+b)/2 and geometric mean the square root of ab until the two values agree.
  • Because the arithmetic mean is always at least the geometric mean, the gap between the two values shrinks quadratically each step, so the iteration converges to high precision in only a few steps.
  • The arithmetic-geometric mean was studied by Gauss and is used to compute the complete elliptic integral of the first kind very efficiently.
  • Both inputs a and b must be positive. When a and b are equal, the arithmetic-geometric mean is simply that value.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Arithmetic-Geometric Mean (AGM) Calculator