Task

Calculate the Feigenbaum constant.



See

   Details in the Wikipedia article:   Feigenbaum constant.


V max_it = 13
V max_it_j = 10
V a1 = 1.0
V a2 = 0.0
V d1 = 3.2
V a = 0.0
 
print(‘ i       d’)
L(i) 2..max_it
   a = a1 + (a1 - a2) / d1
   L(j) 1..max_it_j
      V x = 0.0
      V y = 0.0
      L(k) 1..(1 << i)
         y = 1.0 - 2.0 * y * x
         x = a - x * x
      a = a - x / y
   V d = (a1 - a2) / (a - a1)
   print(‘#2    #.8’.format(i, d))
   d1 = d
   a2 = a1
   a1 = a