begin comment The Whetstone Benchmark. See: A Synthetic Benchmark, H.J. Curnow and B.A. Whichmann, The Computing Journal, Volume 19 Number 1 Feb 1976, P. 43-49 Some results (in thousands of Whetstone Instructions per second): IBM 3090: (Delft ?) Algol Compiler 5000 Sun 3/60: Nase Algol Interpreter 10 Nase Algol2C 400 Sparc 2: Nase Algol Interpreter 63 Nase Algol2C 4200 Pyramid ??: Nase Algol Interpreter 20 ``Nase'' indicates NASE A60. ; real X1, X2, X3, X4, X, Y, Z, T, T1, T2; array E1[1:4]; integer I, J, K, L, N1, N2, N3, N4, N5, N6, N7, N8, N9, N10,N11; procedure PA(E); array E; begin integer J; J ≔ 0; LAB: E[1] ≔ (E[1] + E[2] + E[3] - E[4]) × T; E[2] ≔ (E[1] + E[2] - E[3] + E[4]) × T; E[3] ≔ (E[1] - E[2] + E[3] + E[4]) × T; E[4] ≔ (- E[1] + E[2] + E[3] + E[4]) / T2; J ≔ J + 1; if J < 6 then goto LAB; end; procedure P0; begin E1[J] ≔ E1[K]; E1[K] ≔ E1[L]; E1[L] ≔ E1[J]; end; procedure P3(X, Y, Z); value X, Y; real X, Y, Z; begin X ≔ T × (X + Y); Y ≔ T × (X + Y); Z ≔ (X + Y) / T2; end; procedure POUT (N, J, K, X1, X2, X3, X4); value N, J, K, X1, X2, X3, X4; integer N, J, K; real X1, X2, X3, X4; begin OUTREAL (1, N); OUTREAL (1, J); OUTREAL (1, K); OUTREAL (1, X1); OUTREAL (1, X2); OUTREAL (1, X3); OUTREAL (1, X4); OUTSTRING (1, “\N”); end; comment initialize constants ; T ≔ 0·499975; T1 ≔ 0·50025; T2 ≔ 2·0; comment read the value of i, controlling total wight: if i = 10 the total weight is one million Whetstone instructions ; comment inreal (2, i) ; I ≔ 10; N1 ≔ 0; N2 ≔ 12 × I; N3 ≔ 14 × I; N4 ≔ 345 × I; N5 ≔ 0; N6 ≔ 210 × I; N7 ≔ 32 × I; N8 ≔ 899 × I; N9 ≔ 616 × I; N10 ≔ 0; N11 ≔ 93 × I; comment module 1: simple identifiers ; X1 ≔ 1·0; X2 ≔ X3 ≔ X4 ≔ - 1·0; for I ≔ 1 step 1 until N1 do begin X1 ≔ (X1 + X2 + X3 - X4) × T; X2 ≔ (X1 + X2 - X3 + X4) × T; X3 ≔ (X1 - X2 + X3 + X4) × T; X4 ≔ (- X1 + X2 + X3 + X4) × T; end; POUT (N1, N1, N1, X1, X2, X3, X4); comment module 2: array elements ; E1[1] ≔ 1·0; E1[2] ≔ E1[3] ≔ E1[4] ≔ -1·0; for I ≔ 1 step 1 until N2 do begin E1[1] ≔ (E1[1] + E1[2] + E1[3] - E1[4]) × T; E1[2] ≔ (E1[1] + E1[2] - E1[3] + E1[4]) × T; E1[3] ≔ (E1[1] - E1[2] + E1[3] + E1[4]) × T; E1[4] ≔ (- E1[1] + E1[2] + E1[3] + E1[4]) × T; end; POUT (N2, N3, N2, E1[1], E1[2], E1[3], E1[4]); comment module 3: as array parameter ; for I ≔ 1 step 1 until N3 do PA(E1); POUT (N3, N2, N2, E1[1], E1[2], E1[3], E1[4]); comment module 4: conditional jumps ; J ≔ 1; for I ≔ 1 step 1 until N4 do begin if J = 1 then J ≔ 2 else J ≔ 3; if J > 2 then J ≔ 0 else J ≔ 1; if J < 1 then J ≔ 1 else J ≔ 0; end; POUT (N4, J, J, X1, X2, X3, X4); comment module 5: omitted ; comment module 6: integer arithmetik ; J ≔ 1; K ≔ 2; L ≔ 3; for I ≔ 1 step 1 until N6 do begin J ≔ J × (K - J) × (L - K); K ≔ L × K - (L - J) × K; L ≔ (L - K) × (K + J) ; comment typo in TCJ ; E1[L-1] ≔ J + K + L; E1[K-1] ≔ J × K × L; end; POUT (N6, J, K, E1[1], E1[2], E1[3], E1[4]); comment module 7: trig functions ; X ≔ Y ≔ 0·5; for I ≔ 1 step 1 until N7 do begin X ≔ T × ARCTAN (T2 × SIN (X) × COS (X) / (COS (X + Y) + COS (X - Y) - 1·0)); Y ≔ T × ARCTAN (T2 × SIN (Y) × COS (Y) / (COS (X + Y) + COS (X - Y) - 1·0)); end; POUT (N7, J, K, X, X, Y, Y); comment module 8: procedure calls ; X ≔ Y ≔ Z ≔ 1·0; for I ≔ 1 step 1 until N8 do P3 (X, Y, Z); POUT (N8, J, K, X, Y, Z, Z); comment module 9: array references ; J ≔ 1; K ≔ 2; L ≔ 3; E1[1] ≔ 1·0; E1[2] ≔ 2·0; E1[3] ≔ 3·0; for I ≔ 1 step 1 until N9 do P0; POUT (N9, J, K, E1[1], E1[2], E1[3], E1[4]); comment module 10: integer arithmetik ; J ≔ 2; K ≔ 3; for I ≔ 1 step 1 until N10 do begin J ≔ J + K; K ≔ J + K; J ≔ K - J; K ≔ K -J -J; end; POUT (N10, J, K, X1, X2, X3, X4); comment module 11: standard functions ; X ≔ 0·75; for I ≔ 1 step 1 until N11 do X ≔ SQRT (EXP (LN (X) / T1)); POUT (N11, J, K, X, X, X, X); end