Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
function agm(x,y)
|
||||
set a = x
|
||||
set g = y
|
||||
while abs(a - g) > 0.00000000001
|
||||
set an = (a + g)/2
|
||||
set gn = sqrt(a * g)
|
||||
set a = an
|
||||
set g = gn
|
||||
set i = i + 1
|
||||
end while
|
||||
set result = g
|
||||
end function
|
||||
|
||||
set x = 1
|
||||
set y = 1/sqrt(2)
|
||||
echo (x + y)/2
|
||||
echo sqrt(x+y)
|
||||
echo agm(x,y)
|
||||
Loading…
Add table
Add a link
Reference in a new issue