Arithmetic-geometric mean: Difference between revisions

Content added Content deleted
(Added Maple implementation)
Line 460: Line 460:
</lang>
</lang>

=={{header|Maple}}==
Maple provides this function under the name GaussAGM. To compute a floating point approximation, use evalf.
<lang Maple>
> evalf( GaussAGM( 1, 1 / sqrt( 2 ) ) ); # default precision is 10 digits
0.8472130847

> evalf[100]( GaussAGM( 1, 1 / sqrt( 2 ) ) ); # to 100 digits
0.847213084793979086606499123482191636481445910326942185060579372659\
7340048341347597232002939946112300
</lang>
Alternatively, if one or both arguments is already a float, Maple will compute a floating point approximation automatically.
<lang Maple>
> GaussAGM( 1.0, 1 / sqrt( 2 ) );
0.8472130847
</lang>

=={{header|Mathematica}}==
=={{header|Mathematica}}==
To any arbitrary precision, just increase PrecisionDigits
To any arbitrary precision, just increase PrecisionDigits