Task

Calculate the Feigenbaum constant.



See

   Details in the Wikipedia article:   Feigenbaum constant.


Feigenbaum =: conjunction define  NB. use:  n Feigenbaum m
 irange=: <. + i.@:>:@:|@:-  NB. inclusive range
 a=. 0 1
 delta=. , 3.2
 for_i. 3 irange n do.
  tmp=. ({: + ({:delta) *inv ({: - _2&{)) a
  for. i. m do.
   'b bp'=. 0
   for. i. 2 ^ <: i do.
    'b bp'=. (tmp - *: b) , 1 _2 p. b * bp
   end.
   tmp=. tmp - b % bp
  end.
  a=. a , tmp
  delta=. delta , %/@:(-/"1) (- 2 3 ,: 1 2) { a
 end.
 2 14j6 14j6 ": (#\ i. # delta) ,. (}. a) ,. delta
)

   8  Feigenbaum  13
 1      1.000000      3.200000
 2      1.310703      3.218511
 3      1.381547      4.385678
 4      1.396945      4.600949
 5      1.400253      4.655130
 6      1.400962      4.666112
 7      1.401114      4.668549
 8      1.401146      4.669061
 9      1.401153      4.669172
10      1.401155      4.669195
11      1.401155      4.669200
12      1.401155      4.669201
