# arithmetic-geometric mean

If $x$ and $y$ are non-negative real numbers, we can form their arithmetic mean $a_{0}=(x+y)/2$ as well as their geometric mean $g_{0}=\sqrt{xy}$. This procedure can be repeated to form a sequence of arithmetic and geometic means $a_{n+1}=(a_{n}+g_{n})/2$ and $g_{n+1}=\sqrt{a_{n}g_{n}}$. By the arithmetic-geometric means inequality we have $a_{n}\geq a_{n+1}\geq g_{n+1}\geq g_{n}$ (with equality holding only when $a_{n}=g_{n}$), hence these sequences converge to a number between $x$ and $y$, with the rate of convergence being superlinear. The arithmetic-geometric mean $M(x,y)$ of $x$ and $y$ is defined as this limit

 $M(x,y)=\lim_{n\to\infty}a_{n},g_{n}.$

The origin of the name is obvious from the construction. Alternative notations for $M(x,y)$ are $\operatorname{agm}(x,y)$ or $\operatorname{AGM}(x,y)$.

The AGM lies between the arithmetic and geometric means of $x$ and $y$,

 $\frac{x+y}{2}\geq M(x,y)\geq\sqrt{xy},$

with equality holding only in case of equality $x=y$. The AGM is also a homogeneous function of degree $1$, namely $M(\alpha x,\alpha y)=\alpha M(x,y)$ for $\alpha>0$. It is also symmetric $M(x,y)=M(y,x)$. These properties are obvious from the construction.

The AGM can be used to numerically evaluate elliptic integrals of the first and second kinds. For example,

 $M(x,y)=\frac{\pi}{4}\frac{x+y}{K\left(\frac{|x-y|}{x+y}\right)},$ (1)

where $K(k)$ is the elliptic integral of the first kind as function of the modulus $k$.

As a numerical method, the arithmetic-geometric mean has much to recommend it. By its nature, it automatically provides upper and lower bounds for the answer, so one does not have to separately estimate error. To compute the arithmetic-geometric mean to a certain accuracy, we only need to carry out the computation until the difference between $a_{n}$ and $g_{n}$ is smaller than the desired accuracy.

Because convergence is superlinear, only a few iterations are necessarry to obtain the answer. For instance, if we compute $M(1,k)$ with $k$ less than a billion, we already obtain at least fifteen-place accuracy after eight iterations, as the following computation of $M(1,123456789)$ shows:

$n$ $g_{n}$ $a_{n}$
0 1.0 123456789.0
1 11111.111060555555 61728395.0
2 828173.3227017411 30869753.055530276
3 5056234.365511624 15848963.189116009
4 8951875.352937901 10452598.777313817
5 9673177.418448625 9702237.06512586
6 9687696.345716598 9687707.241787244
7 9687701.793750389 9687701.793751922
8 9687701.793751154 9687701.793751154

The fact that relatively few iterations are necessarry to obtain a highly accurate result also means that one does not have to worry much about the cumulative effect of roundoff errors in the various steps of the computation.

Title arithmetic-geometric mean ArithmeticgeometricMean 2013-03-22 14:23:46 2013-03-22 14:23:46 rspuzio (6075) rspuzio (6075) 7 rspuzio (6075) Definition msc 26E60 msc 33E05 agm AGM EllipticIntegralsAndJacobiEllipticFunctions