RosettaCodeData/Task/Arithmetic-geometric-mean/Potion/arithmetic-geometric-mean.potion
2016-12-05 23:44:36 +01:00

17 lines
187 B
Text

sqrt = (x) :
xi = 1
7 times :
xi = (xi + x / xi) / 2
.
xi
.
agm = (x, y) :
7 times :
a = (x + y) / 2
g = sqrt(x * y)
x = a
y = g
.
x
.