Arithmetic-geometric mean: Difference between revisions

Add "dc" version
imported>Schraf
(Add "dc" version)
Line 1,287:
2
The arithmetic-geometric mean is 1,456791</pre>
 
=={{header|dc}}==
<syntaxhighlight lang="dc">>> [125k ? sbsa [lalb +2/dsc lalb *vdsb lcsa - 0!=:]ds:xlap]sm
>>> lmx
?> 1 1 2 v /</syntaxhighlight>
 
{{out}}
<pre>
.8472130847939790866064991234821916364814459103269421850605793726597\
3400483413475972320029399461122994212228562523341096309793
</pre>
 
You can change the precision (125 by default)
 
=={{header|EchoLisp}}==
Anonymous user