Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
|
|
@ -1,10 +1,13 @@
|
|||
numfmt 6 0
|
||||
a1 = 1 ; a2 = 0 ; d1 = 3.2
|
||||
numfmt 0 6
|
||||
a1 = 1
|
||||
a2 = 0
|
||||
d1 = 3.2
|
||||
ipow2 = 4
|
||||
for i = 2 to 13
|
||||
a = a1 + (a1 - a2) / d1
|
||||
for j = 1 to 10
|
||||
x = 0 ; y = 0
|
||||
x = 0
|
||||
y = 0
|
||||
for k = 1 to ipow2
|
||||
y = 1 - 2 * y * x
|
||||
x = a - x * x
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
/*REXX pgm calculates the (Mitchell) Feigenbaum bifurcation velocity, #digs can be given*/
|
||||
parse arg digs maxi maxj . /*obtain optional argument from the CL.*/
|
||||
if digs=='' | digs=="," then digs= 30 /*Not specified? Then use the default.*/
|
||||
if maxi=='' | maxi=="," then maxi= 20 /* " " " " " " */
|
||||
if maxJ=='' | maxJ=="," then maxJ= 10 /* " " " " " " */
|
||||
#= 4.669201609102990671853203820466201617258185577475768632745651343004134330211314737138,
|
||||
|| 68974402394801381716 /*◄──Feigenbaum's constant, true value.*/
|
||||
numeric digits digs /*use the specified # of decimal digits*/
|
||||
a1= 1
|
||||
a2= 0
|
||||
d1= 3.2
|
||||
say 'Using ' maxJ " iterations for maxJ, with " digs ' decimal digits:'
|
||||
say
|
||||
say copies(' ', 9) center("correct", 11) copies(' ', digs+1)
|
||||
say center('i', 9, "─") center('digits' , 11, "─") center('d', digs+1, "─")
|
||||
|
||||
do i=2 for maxi-1
|
||||
a= a1 + (a1 - a2) / d1
|
||||
do maxJ
|
||||
x= 0; y= 0
|
||||
do 2**i; y= 1 - 2 * x * y
|
||||
x= a - x*x
|
||||
end /*2**i*/
|
||||
a= a - x / y
|
||||
end /*maxj*/
|
||||
d= (a1 - a2) / (a - a1) /*compute the delta (D) of the function*/
|
||||
t= max(0, compare(d, #) - 2) /*# true digs so far, ignore dec. point*/
|
||||
say center(i, 9) center(t, 11) d /*display values for I & D ──►terminal*/
|
||||
parse value d a1 a with d1 a2 a1 /*assign 3 variables with 3 new values.*/
|
||||
end /*i*/
|
||||
/*stick a fork in it, we're all done. */
|
||||
say left('', 9 + 1 + 11 + 1 + t )"↑" /*show position of greatest accuracy. */
|
||||
say ' true value= ' # / 1 /*true value of Feigenbaum's constant. */
|
||||
|
|
@ -1,20 +1,20 @@
|
|||
arg n; if n = '' then n = 30; numeric digits n
|
||||
parse version version; say version; glob. = ''
|
||||
say 'First Fiegenbaum constant, correct to about 11 decimals'
|
||||
say 'Using algorithm cf RosettaCode'
|
||||
-- 8 May 2025
|
||||
say 'FIRST FEIGENBAUM CONSTANT'
|
||||
say 'Using algorithm cf RosettaCode, correct to about 11 decimals'
|
||||
say
|
||||
call time('r'); a = Original(); e = format(time('e'),,3)
|
||||
arg n; if n = '' then n = 30; numeric digits n
|
||||
call Time('r'); a = Original(); e = Format(Time('e'),,3)
|
||||
say 'Original ' a '('e 'seconds)'
|
||||
call time('r'); a = Optimized(); e = format(time('e'),,3)
|
||||
call Time('r'); a = Optimized(); e = Format(Time('e'),,3)
|
||||
say 'Optimized ' a '('e 'seconds)'
|
||||
call time('r'); a = TrueValue(); e = format(time('e'),,3)
|
||||
call Time('r'); a = TrueValue(); e = Format(Time('e'),,3)
|
||||
say 'True value' a '('e 'seconds)'
|
||||
exit
|
||||
|
||||
Original:
|
||||
procedure expose glob.
|
||||
/* Outer 2 loops with a fixed value */
|
||||
numeric digits digits()+2
|
||||
numeric digits Digits()+2
|
||||
im = 20; jm = 10
|
||||
a1 = 1; a2 = 0; d1 = 3.2
|
||||
do i = 2 to im
|
||||
|
|
@ -29,13 +29,13 @@ do i = 2 to im
|
|||
d = (a1-a2) / (a-a1)
|
||||
parse value d a1 a with d1 a2 a1
|
||||
end
|
||||
numeric digits digits()-2
|
||||
numeric digits Digits()-2
|
||||
return d+0
|
||||
|
||||
Optimized:
|
||||
procedure expose glob.
|
||||
/* Center loop stops on achieving desired accuracy */
|
||||
numeric digits digits()+4; numeric fuzz 4
|
||||
numeric digits Digits()+4; numeric fuzz 4
|
||||
/* Only outer loop maximum */
|
||||
im = 20
|
||||
a1 = 1; a2 = 0; d1 = 3.2
|
||||
|
|
@ -54,8 +54,9 @@ do i = 2 to im
|
|||
end
|
||||
d = (a1-a2) / (a-a1)
|
||||
parse value d a1 a with d1 a2 a1
|
||||
say Format(i,2) Format(d,1,12)
|
||||
end
|
||||
numeric digits digits()-4
|
||||
numeric digits Digits()-4
|
||||
return d+0
|
||||
|
||||
TrueValue:
|
||||
Loading…
Add table
Add a link
Reference in a new issue