Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -1,8 +1,15 @@
-- 8 May 2025
-- 28 Jul 2025
include Settings
arg n
if n = '' then
n = 30
numeric digits n
say 'FIRST FEIGENBAUM CONSTANT'
say version
say
say 'Using algorithm cf RosettaCode, correct to about 11 decimals'
say
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)
@ -12,8 +19,8 @@ say 'True value' a '('e 'seconds)'
exit
Original:
procedure expose glob.
/* Outer 2 loops with a fixed value */
procedure expose Memo.
-- Outer 2 loops with a fixed value
numeric digits Digits()+2
im = 20; jm = 10
a1 = 1; a2 = 0; d1 = 3.2
@ -33,10 +40,10 @@ numeric digits Digits()-2
return d+0
Optimized:
procedure expose glob.
/* Center loop stops on achieving desired accuracy */
procedure expose Memo.
-- Center loop stops on achieving desired accuracy
numeric digits Digits()+4; numeric fuzz 4
/* Only outer loop maximum */
-- Only outer loop maximum
im = 20
a1 = 1; a2 = 0; d1 = 3.2
do i = 2 to im
@ -47,7 +54,7 @@ do i = 2 to im
y = 1 - 2*x*y; x = a - x*x
end
a = a - x/y
/* Stop second loop when a does not change anymore */
-- Stop second loop when a does not change anymore
if a = v then
leave
v = a
@ -60,5 +67,7 @@ numeric digits Digits()-4
return d+0
TrueValue:
procedure expose glob.
procedure expose Memo.
return 4.66920160910299067185320382046620161725818557747576863274565134300413433021131473713868974402394801381716+0
include Abend