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) computes the arithmetic
geometric mean of the numbers a and b.
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
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:
The function is sensitive to the environment variable
A floating-point number is returned if the arguments can be converted to floating-point numbers:
numeric::gaussAGM(1 + I, 1 + 2*I)
A symbolic call is returned if one of the arguments cannot be converted to a float:
For the special cases a = 0, b = 0 and a + b = 0, the result 0.0 is returned even for symbolic arguments:
Floating point number or a symbolic call