DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen GIER Computer

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen GIER Computer

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦45b0cf050⟧ Bits:30000608 Naur Demon 5-10-65 Algol III, 8-hole paper tape

    Length: 4321 (0x10e1)
    Description: Bits:30000608 Naur Demon 5-10-65  Algol III
    Types: 8-hole paper tape
    Notes: Gier Text, Has10

GIER Text (HTML)

Demonstration program
begin _____
writetext(|< <
The present program will demonstrate some of the features of the ALGOL compile the GIER (DISADEC). We start with a simple program which compares the built-in standard function ln with the integral of 1/x, calculated by means of a Simpson algorithm with automatic determination of the proper step size. Here we go:
p ln(p) Integral ln(p)-Integral|); >
begin integer i; real x, arg, log; _____ _______ ____
real procedure Simps(F,x,a,b,delta,V); value a,b,delta,V; real F,x,a,b, ____ _________ _____ ____
delta,V;
begin integer n,k; real h,J, I; _____ _______ ____
V := (b-a)⨯V; n := 1; h := (b-a)/2; x := a; J := F; x := b; J := (J+F)⨯h;
J1: b := 0; for k := 1 step 1 until n do ___ ____ _____ __
begin x := (2⨯k - 1)⨯h + a; b := b + F end; _____ ___
I := 4 ⨯ h ⨯ b + J;
if abs(V) ⨯ delta < abs(I - V) then __ ____
begin V := I; J := (I+J)/4; n := 2⨯n; h := h/2; go_to J1 end; _____ __ __ ___
Simps := I/3
end Simps; ___
for i := 80 step 4 until 200 do ___ ____ _____ __
begin arg := i/100; _____
writecr; write(|d.dd|, arg); < >
log := Simps(1/x, x, 1, arg, 10-7, 1000);
write(|-ddd.ddddddddd|, ln(arg), log, ln(arg) - log) < >
end ___
end; ___
writetext(|< <
Next we want to demonstrate the automatic administration of the transfer of program drum tracks which takes place at run time. We run in a small loop containing a block with an array running from 1 to i. We gradually increase i from 500 and upwards in steps of 10. In addition we do a calculation which will call for references to several different drum tracks inside the loop. As the array grows the time used for the calculation increases markedly owing to the more frequent drum transfers forced by the decreased space available for program.
|); >
begin integer i, j; _____ _______
for i := 500 step 10 until 700 do ___ ____ _____ __
begin outcr; output(|dddd|, i); _____ < >
begin array a[1:i]; _____ _____
for j := 1 step 1 until i do a[j] := j + sin(j) - exp(-j) ___ ____ _____ __
end ___
end ___
end; ___
writetext(|< <
The next program makes use of a recursive procedure for summing, SIGMA. SIGMA calculates a sum of terms as the first term plus the sum of the rest. This means that to calculate the sum of i terms the
procedure is called recursively to the i-th level.|); >
begin integer k, i; _____ _______
real procedure SIGMA(p, q, r, f); value q, r; integer p, q, r; ____ _________ _____ _______
real f; ____
begin p := q; _____
SIGMA := if q>r then 0 else f + SIGMA(p, q+1, r, f) __ ____ ____
end; ___
for k := 50 step 1 until 65 do ___ ____ _____ __
begin writecr; _____
write(|ddd|, k); < >
write(|ddddddd|, SIGMA(i, 1, k, 2⨯i)) < >
end ___
end; ___
writetext(|< <
The final demonstration is an example of how it is possible in Algol (like in any other language) to express simple things in a com- plicated way. We use here the ridiculously complicated process devised by Knuth and Merner (Comm.ACM June 1961) for the calculation of the first 20 primes. i Prime number i
|); >
begin integer m, P, I, A, Z; _____ _______
real procedure GPS(II,N,ZZ,V); real II,N,ZZ,V; ____ _________ ____
begin for II:= 1 step 1 until N do ZZ := V; _____ ___ ____ _____ __
GPS := 1
end; ___
for m := 1 step 1 until 20 do ___ ____ _____ __
begin I := GPS(I,if I=0 then -1.0 else I,P,if I=1 then 1.0 else _____ __ ____ ____ __ ____ ____
if GPS(A,I,Z,if A=1 then 1 else __ __ ____ ____
if entier(A) ⨯ (entier(I)_entier(A))=entier(I)∧A<I __ :
then 0 else Z) = Z then ____ ____ ____
(if P<m then P+1 else I ⨯ GPS(A,1,I,-1)) else P); __ ____ ____ ____
writecr;
write(|ddddd|, m, P) < >
end ___
end; ___
end of the demonstration program; ___