Task

Calculate the Feigenbaum constant.



See

   Details in the Wikipedia article:   Feigenbaum constant.


var a1 = 1
var a2 = 0
var δ  = 3.2.float
 
say " i\tδ"
 
for i in (2..15) {
    var a0 = ((a1 - a2)/δ + a1)
    10.times {
        var (x, y) = (0, 0)
        2**i -> times {
            y = (1 - 2*x*y)
            x = (a0 - x²)
        }
        a0 -= x/y
    }
    δ = ((a1 - a2) / (a0 - a1))
    (a2, a1) = (a1, a0)
    printf("%2d %.8f\n", i, δ)
}