This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Gauss' arithmetic geometric mean

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


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?