|
DataMuseum.dkPresents historical artifacts from the history of: RegneCentralen GIER Computer |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RegneCentralen GIER Computer Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 18333 (0x479d) Description: Bits:30000742 Testprogrammer til GA III dobbeltpræcisionsaritmetik Types: 8-hole paper tape Notes: Gier Text, Has10
begin _____procedure Test(a); _________string a; ______begin _____writecr; writetext(a); outsp(50);outtext(|< <Test |,a) >end; ___Test(|<10.127|); < >begin _____integer i,j,j1; _______real ul,arg,a1,max,m1,maxarg,ma1,exlog,e1,r1,r11,r2,r21,h,h1,rm,ru; ____outtext(|< double ln, double exp, exlog|, outcr,outcr,outcr, < >|<arg1 ln(arg1)|,outsp(23),|<rel.error|,outcr); < > < >for i:=100 step 50 until 300 do ___ ____ _____ __begin _____max:=m1:=0; j1:=0;for j:=i-50 step 1 until i do ___ ____ _____ __begin _____assign(arg,div(j,100)); assign(exlog,doubleexp(doubleln(arg))); assign(h,sub(arg,exlog));if abs(h)>abs(max) then __ ____begin _____assign(max,h); assign(maxarg,arg)end ___end; ___outcr; output(|d.dd|,maxarg,outsp(3)); < >doubleoutput(20,doubleln(maxarg),outsp(3));output(|-d.d10 +dd|,div(max,maxarg)) < >end; ___outcr; outcr;outtext(|<arg2|,outsp(29),|<ln(arg2)|,outsp(24), < > < >|<abs.error2 rel.error2|,outcr); < >assign(r1,div(1,mult(power(10,64),power(10,76))));for j:=j while r1<10 125 do ___ _____ __begin _____max:=m1:=0; ul:=210 19⨯r1; assign(r2,r1);for j:=j while r2<ul do ___ _____ __begin _____assign(exlog,doubleexp(doubleln(r2))); assign(h,sub(r2,exlog));if sub(double abs(h),doubleabs(max))>0 then __ ____begin _____assign(max,h); assign(maxarg,r2)end; ___assign(r2,mult(10,r2))end; ___outcr; doubleoutput(20,maxarg, outsp(5),doubleln(maxarg),outsp(5));output(|-d.ddiv(div(max,maxarg),doubleln(maxarg)));10 +dd|,div(max,maxarg),outsp(4), < >assign(r1,if 0.9<r1∧r1<1.1∧-,(r1=1∧r11=0) then 1 else __ ____ ____mult(r1,power(10,20)))end; ___outchar(42)end; ___Test(|<10.128|); < >begin _____integer q,q1,y,y1,upy,lowy,maxq,maxupy,maxlowy; _______real max,m1,up,u1,low,l1,log,l2,dif,d1,M,M1,e,e1,h,h1; ____procedure print(u,u1); _________value u,u1; _____real u,u1; ____begin _____real w,w1; ____assign(w,doubleln(u)); outcr;output(|dd.dd|,u,outsp(2)); < >doubleoutput(20,w,outsp(2),mult(w,M))end; ___doubleinput(M,e);outtext(|< double ln|,outcr,outcr,outcr); < >max:=-1; m1:=0; q1:=y1:=0;for q:=11 step 1 until 19,20 step 10 until 90 do ___ ____ _____ ____ _____ __begin _____assign(up,sub(doubleln(div(q,10)),1)); assign(low,add(up,2));for y:=1 step 1 until 100 do ___ ____ _____ __begin _____assign(log,sub(doubleln(div(q⨯y,100)),doubleln(div(y,10))));if sub(log,up)>0 then __ ____begin _____upy:=y; assign(up,log)end; ___if sub(log,low)<0 then __ ____begin _____lowy:=y; assign(low,log)end ___end; ___assign(dif,sub(up,low));if sub(dif,max)>0 then __ ____begin _____maxq:=q; maxupy:=upy; maxlowy:=lowy; assign(max,dif)end ___end; ___outcr;output(|nd.d|,maxq/10); < >outsp(4);output(|d.doutcr; outcr;10 +dd|,max); < >outtext(|< x ln(x) log10 (x)|); < >for y:=maxlowy,maxupy do ___ __begin _____outcr; assign(h,div(maxq⨯y,100)); print(h,h1); assign(h,div(y,10)); print(h,h1)end; ___outcr; print(1,0); outcr; print(e,e1); outcr; print(10,0); outcr; outchar(42)end; ___Test(|<10.129|); < >begin _____integer k; _______real arg,arg1,max,max1,maxarg,maxarg1,konst,konst1,hj,hj1, ____basearg,basearg1,relative error,relative error 1;outtext(|< double sqrt|,outcr,outcr,outcr,|<arg|,outsp(28), < > < >|<sqrt(arg)|,outsp(22),|<rel.error|,outcr); < > < >assign(konst,div(11,10));for k:=-100 step 50 until 150 do ___ ____ _____ __begin _____assign(basearg,if k<0 then div(1,power(10,-k)) else __ ____ ____if k<150 then power(10,k) else __ ____ ____mult(power(10,64),power(10,86))); max := -1; max1 := 0; assign(arg,div(basearg,power(10,50)));for k:=k while sub(arg,basearg)<0 do ___ _____ __begin _____assign(hj,doublesqrt(arg)); assign(relative error,div(doubleabs(sub(mult(hj,hj),arg)),arg));if sub(relative error,max)>0 then __ ____begin _____assign(max,relative error); assign(maxarg,arg)end; ___assign(arg,mult(arg,konst))end; ___doubleoutput(20,outcr,maxarg,outsp(3),doublesqrt(maxarg),outsp(3));output(|d.d10 -dd|,max); < >end; ___outchar(42)end; ___Test(|<10.130|); < >begin _____real x,x1,h,h1; ____outtext(|< double exp|,outcr,outcr,outcr,|<arg|, < > < >outsp(27),|<exp(arg)|,outcr,outcr); < >doubleoutput(20,0,outsp(2),doubleexp(0)); x:=-1; x1:=0;for x:=2⨯x while x>-10 50 do ___ _____ __begin _____assign(h,doubleexp(x));if h_0 then __ < ____begin _____outcr; doubleoutput(20,x,outsp(2),h,outcr); assign(h,doubleexp(mult(3,x)/4)); doubleoutput(20,mult(3,x)/4,outsp(2),h); x:=-1; x1:=0;goto B ____end ___end; ___B: for x:=x/2 while abs(x)>10 -20 do ___ _____ __begin _____assign(h,doubleexp(x));if h=1∧h1=0 then __ ____begin _____outcr; doubleoutput(20,x,outsp(2),h,outcr, mult(3,x)/2,outsp(2), doubleexp(mult(3,x)/2));if x<0 __then begin x:=1; goto B end ____ _____ ____ ___else goto A ____ ____end ___end; ___A: for x:=1,x⨯2 while x<512 do ___ _____ __doubleoutput(20,outcr,x,outsp(2),doubleexp(x)); outchar(42)end; ___Test(|<10.131|); < >begin _____integer n,n1,i,j,j1; _______real max,m1,arg,a1,plog,pl1,ppow,pp1,h,h1,maxarg,ma1; ____outtext(|< double exp,double ln|,outcr,outcr,outcr,|<n|,outsp(4), < > < >|<arg|,outsp(4),|<abs error|,outsp(3),|<rel error|,outcr); < > < > < >n1:=0;for n:=2,3,5,10 do ___ __begin _____outcr;output(|nd|,n,outsp(3)); < >for i:=100 step 50 until 300 do ___ ____ _____ __begin _____max:=m1:=0; j1:=0;for j:=i-50 step 1 until i do ___ ____ _____ __begin _____assign(arg,div(j,100)); assign(plog,doubleexp(mult(n,doubleln(arg)))); assign(ppow,power(arg,n)); assign(h,sub(plog,ppow));if abs(h)>abs(max) then __ ____begin _____assign(max,h); assign(maxarg,arg)end ___end; ___output(|d.dd|,maxarg); outsp(3); < >assign(h,div(max,power(maxarg,n)));output(|-d.dd10 +dd|,max,outsp(3),h,outcr,outsp(5)) < >end; ___outcrend; ___doubleoutput(20,outcr,doubleln(doubleexp(1)),outcr, doubleln(doubleln(doubleexp(doubleexp(div(1,100)))))); outchar(42)end; ___Test(|<10.132|); < >begin _____integer i,j,j1; _______real arg,a1,max,m1,maxarg,ma1,logex,e1,h,h1; ____outtext(|< double ln, double exp, logex|,outcr,outcr,outcr, < >|<arg ln(exp(arg))|,outsp(18),|<rel.error|,outcr); < > < >for i:=100 step 50 until 300 do ___ ____ _____ __begin _____max:=m1:=0; j1:=0;for j:=i-50 step 1 until i do ___ ____ _____ __begin _____assign(arg,div(j,100)); assign(logex,doubleln(doubleexp(arg))); assign(h,sub(arg,logex));if abs(h)>abs(max) then __ ____begin _____assign(max,h); assign(maxarg,arg)end ___end; ___outcr;output(|d.dd|,maxarg,outsp(3)); < >doubleoutput(20,doubleln(doubleexp(maxarg))); outsp(3);output(|-d.d10 +dd|, max/maxarg) < >end; ___outchar(42)end; ___Test(|<10.133|); < >begin _____integer i,i1,k,k1; _______real s,s1,x,x1,led,led1,de,de1; ____outtext(|< double exp|,outcr,outcr,outcr,|<x|,outsp(6), < > < >|<exp(x) - Taylor|,outsp(14),|<exp(x)|,outsp(27), < > < >|<abs.error rel.error|,outcr); < >i1:=k1:=0;for i:=-50,-20,-15,-10 step 1 until 10, 15,20,50 do ___ ____ _____ __begin _____assign(s,1); assign(led,s); assign(x,div(i,10)); k:=2; L: k:=k+1; assign(led,div(mult(x,led),k)); assign(s,add(s,led));if abs(led)>assign(s,add(1,add(x,mult(mult(x,x),div(s,2)))));10 -20 then goto L; __ ____ ____output(|-d.d|,outcr,x,outsp(2)); < >assign(de,doubleexp(x)); doubleoutput(20,s,outsp(2),de,outsp(4));output(|-d.d10 -dd|,sub(s,de),outsp(4),div(sub(s,de),s)); < >end; ___outchar(42)end; ___Test(|<10.134|); < >begin _____integer i,i1,k,k1,m,j; _______real pi,pi1,s,s1,x,x1,xh,xh1,xsq,xsq1,led,led1,max,max1, ____maxh,maxh1,maxi,maxs,maxs1,maxx,maxx1;outtext(|< double sin|,outcr,outcr,outcr,|<pi|, < > < >outsp(26),|<degrees sin(x) - Taylor|, < >outsp(15),|<sin(x)|,outsp(23),|<abs.error rel.error|,outcr); < > < >i1:=k1:=0;for j:=1,2 do ___ __begin _____assign(pi,doubleinone); doubleoutput(20,outcr,outcr,pi); assign(xh,div(pi,1800));for m:=400 step 400 until 4000 do ___ ____ _____ __begin _____max:=max1:=0;for i:=m-400 step 5 until m do ___ ____ _____ __begin _____assign(x,mult(xh,i)); assign(xsq,mult(x,x)); assign(s,assign(led,div(xsq,20))); k:=4; L: k:=k+2; assign(led,div(div(mult(minus(xsq),led),k),k+1)); assign(s,add(s,led));if abs(led)>mult(assign(s,add(x,div(mult(sub(s,1),mult(xsq,x)),6))); assign(maxh,doubleabs(sub(s,doublesin(x))));10 -20,doubleabs(s)) then goto L; __ ____ ____if sub(maxh,max)>0 then __ ____begin _____assign(max,maxh); maxi:=i; assign(maxs,s); assign(maxx,x)end ___end; ___output(|ndd.d|,maxi/10,outsp(4)); < >assign(x,maxx); assign(s,doublesin(x)); doubleoutput(20,maxs,outsp(2),s,outsp(3));output(|-d.ddiv(max,add(doubleabs(s),doubleabs(mult(x,doublecos(x)))))); outcr; outsp(28)10 -dd|,max,outsp(3), < >end; ___end ___outchar(42)end; ___Test(|<10.135|); < >begin _____integer i,i1,k,k1,m,j; _______real pi,pi1,s,s1,x,x1,xh,xh1,xsq,xsq1,led,led1,max,max1, ____maxh,maxh1,maxi,maxs,maxs1,maxx,maxx1;outtext(|< double cos|,outcr,outcr,outcr,|<pi|, < > < >outsp(26),|<degrees cos(x) - Taylor|, < >outsp(15),|<cos(x)|,outsp(24),|<abs.error rel.error|,outcr); < > < >i1:=k1:=0;for j:=1,2 do ___ __begin _____assign(pi,doubleinone); doubleoutput(20,outcr,outcr,pi); assign(xh,div(pi,1800));for m:=400 step 400 until 4000 do ___ ____ _____ __begin _____max:=max1:=0;for i:=m-400 step 5 until m do ___ ____ _____ __begin _____assign(x,mult(xh,i)); assign(xsq,mult(x,x)); assign(s,assign(led,div(xsq,12))); k:=3; L: k:=k+2; assign(led,div(div(mult(minus(xsq),led),k),k+1)); assign(s,add(s,led));if abs(led)>mult(assign(s,add(1,div(mult(sub(s,1),xsq),2))); assign(maxh,doubleabs(sub(s,doublecos(x))));10 -20,doubleabs(s)) then goto L; __ ____ ____if sub(maxh,max)>0 then __ ____begin _____assign(max,maxh); maxi:=i; assign(maxs,s); assign(maxx,x)end ___end; ___output(|ndd.d|,maxi/10,outsp(4)); < >assign(x,maxx); assign(s,doublecos(x)); doubleoutput(20,maxs,outsp(2),s,outsp(3));output(|-d.ddiv(max,add(doubleabs(s),doubleabs(mult(x,doublesin(x)))))); outcr; outsp(28)10 -dd|,max,outsp(3), < >end; ___end; ___outchar(42)end; ___Test(|<10.136|); < >begin _____integer m,i,i1,k,k1,maxi,j; _______real pi,pi1,max,max1,angle,angle1,arg,arg1,standard,standard1,led,led1, ____sum,sum1,pow,pow1,argsq,argsq1,maxarg,maxarg1,maxstd,maxstd1;outtext(|< double arctan|,outcr,outcr,outcr); < >i1:=k1:=0;for j:=1,2 do ___ __begin _____assign(pi,doubleinone); outcr;doubleoutput(20,outtext(|<pi = |),pi,outcr); < >outtext(outcr,|<degr. x|,outsp(27),|<arctan(x)|,outsp(20), < > < >|<arctan(x) - Taylor|,outsp(11),|<arctan/pi⨯180|, < > < >outsp(16),|<rel.error|,outcr); < >for m:=100 step if m<200 then 100 else 500 until 5200 do ___ ____ __ ____ ____ _____ __begin _____assign(max,-1);for i:=m-(if m_200 then 100 else 500) step ___ __ < ____ ____ ____if m_200 then 1 else 10 until m do __ < ____ ____ _____ __begin _____assign(angle,mult(pi,div(i,18000))); assign(arg,div(doublesin(angle),doublecos(angle)));if i<2700 then __ ____begin _____assign(pow,minus(power(arg,3))); assign(argsq,minus(mult(arg,arg))); k:=3; assign(sum,0); L: assign(pow,mult(pow,argsq)); k:=k+2; assign(led,div(pow,k)); assign(sum,add(sum,led));if sub(doubleabs(led),mult(10 -20,doubleabs(sum)))>0 __then goto L; ____ ____assign(standard,add(mult(argsq,div(arg,3)),add(sum,arg)));end ___else assign(standard,angle); ____assign(angle,doublearctan(arg));if sub(doubleabs(sub(standard,angle)),max)>0 then __ ____begin _____maxi:=i; assign(maxarg,arg); assign(maxstd,standard); assign(max,doubleabs(sub(standard,angle)))end ___end; ___output(|nd.dd|,outcr,maxi/100,outsp(1)); < >assign(angle,doublearctan(maxarg)); doubleoutput(20,maxarg,outsp(1),angle,outsp(1),maxstd,outsp(1), mult(180,div(angle,pi)));output(|-d.d10 -dd|,outsp(1),div(max,add(angle,10 -21))) < >end; ___end; ___outchar(42)end ___end; ___data double ln: 0.43429 44819 03251 82765, 2.71828 18284 59045 23536 data double sin: 3.14159 26535 89793 23835, 3.14159 26535 89793 23855 data double cos: 3.14159 26535 89793 23835, 3.14159 26535 89793 23855 data double arctan: 3.14159 26535 89793 23835, 3.14159 26535 89793 23855