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]) TIMES T;
        E[2] := (E[1] + E[2] - E[3] + E[4]) TIMES T;
        E[3] := (E[1] - E[2] + E[3] + E[4]) TIMES 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 TIMES (X + Y);
        Y := T TIMES (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 WHIGHT IS ONE MILLION WHETSTONE INSTRUCTIONS 
    ;
    comment  INREAL (2, I) 
    ;
    I := 10;
    N1 := 0;
    N2 := 12 TIMES I;
    N3 := 14 TIMES I;
    N4 := 345 TIMES I;
    N5 := 0;
    N6 := 210 TIMES I;
    N7 := 32 TIMES I;
    N8 := 899 TIMES I;
    N9 := 616 TIMES I;
    N10 := 0;
    N11 := 93 TIMES 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) TIMES T;
        X2 := (X1 + X2 - X3 + X4) TIMES T;
        X3 := (X1 - X2 + X3 + X4) TIMES T;
        X4 := (-X1 + X2 + X3 + X4) TIMES 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]) TIMES T;
        E1[2] := (E1[1] + E1[2] - E1[3] + E1[4]) TIMES T;
        E1[3] := (E1[1] - E1[2] + E1[3] + E1[4]) TIMES T;
        E1[4] := (-E1[1] + E1[2] + E1[3] + E1[4]) TIMES 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 TIMES (K - J) TIMES (L - K);
        K := L TIMES K - (L - J) TIMES K;
        L := (L - K) TIMES (K + J);
        comment  TYPO IN TCJ 
        ;
        E1[L - 1] := J + K + L;
        E1[K - 1] := J TIMES K TIMES 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 TIMES ARCTAN(T2 TIMES SIN(X) TIMES COS(X) ÷ (COS(X + Y) + COS(X - Y) - 1.0));
        Y := T TIMES ARCTAN(T2 TIMES SIN(Y) TIMES 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 ;