Gauss' arithmetic geometric mean

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.


numeric::gaussAGM(a, b)


numeric::gaussAGM(a, b) computes the arithmetic geometric mean of the numbers a and b.

The iteration

with the starting values a0 = a, b0 = b converges quadratically to some value . This limit is called Gauss' arithmetic geometric mean of the starting values a, b.

If both arguments a and b can be converted to real or complex floating-point numbers, then a floating point value is computed and returned. Otherwise, the symbolic call numeric::gaussAGM(a, b) is returned.

If a = 0 or b = 0 or a + b = 0, then 0.0 is returned, even if a or b are symbolic objects.

The following relation to elliptic integrals holds for all complex values a and b:


Environment Interactions

The function is sensitive to the environment variable DIGITS.


Example 1

A floating-point number is returned if the arguments can be converted to floating-point numbers:

numeric::gaussAGM(0, 5)

numeric::gaussAGM(sqrt(2), PI)

numeric::gaussAGM(-10, PI)

numeric::gaussAGM(1 + I, 1 + 2*I)

A symbolic call is returned if one of the arguments cannot be converted to a float:

numeric::gaussAGM(1, b)

For the special cases a = 0, b = 0 and a + b = 0, the result 0.0 is returned even for symbolic arguments:

numeric::gaussAGM(a, 0)

numeric::gaussAGM(a, -a)


a, b

arithmetical expressions

Return Values

Floating point number or a symbolic call numeric::gaussAGM(a, b).

See Also

MuPAD Functions

Was this topic helpful?