Arithmetic-geometric mean: Difference between revisions

Added Uiua solution
(Added various BASIC dialects (Applesoft BASIC, Gambas, MSX Basic, Minimal BASIC, QuiteBASIC and Yabasic))
(Added Uiua solution)
 
(2 intermediate revisions by 2 users not shown)
Line 600:
==={{header|Minimal BASIC}}===
{{trans|Commodore BASIC}}
{{works with|IS-BASIC}}
<syntaxhighlight lang="qbasic">10 LET A = 1
20 LET G = 1 / SQR(2)
Line 3,475 ⟶ 3,476:
</pre>
 
=={{header|Uiua}}==
<syntaxhighlight lang="uiua">
# Calculate the arithmetic-geometric mean
Agm ← ⊙◌◌⍢(⊃(√×|÷2+)|<⌵-)
Agm 1 ÷:1√2 0.0000001
</syntaxhighlight>
{{out}}
<pre>
0.8472130848351929
</pre>
=={{header|UNIX Shell}}==
{{works with|ksh93}}
Line 3,532 ⟶ 3,543:
=={{header|Wren}}==
{{trans|Go}}
<syntaxhighlight lang="ecmascriptwren">var eps = 1e-14
 
var agm = Fn.new { |a, g|
161

edits