12 lines
257 B
Text
12 lines
257 B
Text
with recursive
|
|
rec(rn, a, g, diff) as (
|
|
select 1, 1.0, 1/sqrt(2), 1 - 1/sqrt(2)
|
|
union all
|
|
select rn + 1, (a + g)/2, sqrt(a * g), (a + g)/2 - sqrt(a * g)
|
|
from rec
|
|
where diff > 1e-15
|
|
)
|
|
select *
|
|
from rec
|
|
where diff <= 1e-15
|
|
;
|