21 lines
603 B
Text
21 lines
603 B
Text
module Feigenbaum_constant_calculation (maxit as integer, c as single){
|
|
locale 1033 // show dot for decimal separator symbol
|
|
single maxitj=13
|
|
integer i, j
|
|
long k
|
|
decimal a1=1, a2, d , d1=3.2, y, x, a
|
|
print "Feigenbaum constant calculation:"
|
|
print
|
|
print format$("{0:-7} {1:-12} {2}","i", "δ","max j")
|
|
for i = 2 to maxit
|
|
a=a1+(a1-a2)/d1
|
|
for j = 1 to maxitj {x=0:y=0:for k=1 to 2&^i {y=1@-2@*y*x:x=a-x*x}:a-=x/y}
|
|
d=(a1-a2)/(a-a1)
|
|
print format$("{0::-7} {1:10:-12} {2::-5}",i, d, j-1)
|
|
maxitj-=c
|
|
d1=d:a2=a1:a1= a
|
|
next
|
|
}
|
|
profiler
|
|
Feigenbaum_constant_calculation 18, .7
|
|
print timecount
|