|
|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1536 (0x600)
Types: TextFile
Names: »tmin1a«
└─⟦00964e8f7⟧ Bits:30007478 RC8000 Dump tape fra HCØ.
└─⟦b2ec5d50f⟧
└─⟦09b4e9619⟧ »thcømat«
└─⟦this⟧
\f
message min1a
min1a=algol message.no
external
real procedure min1a(f,x,step1,eps,minstep,d2);
value eps,minstep;
real f,x,step1,eps,minstep,d2;
begin
real q0,q1,q2,x0,q,stepp;
stepp:=step1;
if abs(stepp)<2*minstep then stepp:=2*minstep;
if eps<0 then eps:=0;
q0:=f; x0:=x;
x:=x0+stepp; q1:=f;
if q1>q0 then
begin
stepp:=-stepp; q2:=q1;
x:=x0+stepp; q1:=f;
end;
if q1<q0 then
begin
x0:=x; q2:=q0; q0:=q1; x:=x0+stepp;
for q1:=f while q1<q0 do
begin
q0:=q1; x0:=x; stepp:=stepp*2; x:=x0+stepp
end
end;
for stepp:=0.5*stepp while abs(stepp)>=minstep
and (q1+q2-2*q0)*3>(abs(q1)+abs(q2)+abs(q0))*eps do
begin
if q1>q2 then
begin
stepp:=-stepp; q:=q1; q1:=q2; q2:=q
end;
x:=x0+stepp; q:=f;
if q>=q0 then
begin
stepp:=-stepp; q1:=q2; q2:=q; x:=x0+stepp; q:=f
end;
if q<q0 then
begin
x0:=x; q2:=q0; q0:=q
end
else q1:=q
end;
min1a:=q0; x:=x0; step1:=stepp;
d2:=(if abs stepp>2'-309 then (q2+q1-2*q0)/(2*stepp)**2 else -1);
end min1a
; end
▶EOF◀