10 PRINT "PROGRAM FILE 61: NUMERIC EXPRESSIONS CONTAINING"
20 PRINT "        SUBSCRIPTED VARIABLES."
30 PRINT "    ANSI STANDARD 6.2, 6.4, 7.2, 7.4"
40 PRINT
50 PRINT "SECTION 61.1: NUMERIC EXPRESSIONS CONTAINING"
60 PRINT "        SUBSCRIPTED VARIABLES."
70 PRINT
80 PRINT "THIS SECTION TESTS WHETHER SUBSCRIPTED VARIABLES"
90 PRINT "CAN BE USED AS PRIMARIES IN NUMERIC EXPRESSIONS."
100 PRINT
110 PRINT "                  BEGIN TEST"
120 PRINT
130 PRINT "CASE #","SHOULD BE","ACTUAL","OUTCOME"
140 PRINT
150 LET F=0
160 LET C1=0
180 REM ARRAY B(I) CONTAINS FIBONACCI SERIES
200 LET B(1)=+001.00
210 LET B(2)=1
220 FOR I=3 TO 10
230 LET J=I-1
240 LET K=I-2
250 LET B(I)=B(J)+B(K)
260 NEXT I
270 LET A=B(5)+B(8)
280 LET Y=26
290 GOSUB 9000
300 LET C(7)=47.23/B(7)+23.E-1
310 LET H9=7.0
320 LET A=C(H9)+H9*B(H9)
330 LET Y=96.933076923
340 GOSUB 9000
350 LET H9=6
360 LET H9=B(H9)
370 LET H9=B(H9)
380 LET Z(0)=(H9/7)^B(4)*20/(B(7)-B(4))-B(10)-.02E+02
390 LET Z(1)=Z(0)+Z(0)
400 LET Z(2)=-Z(0)-Z(0)
410 LET Z(3)=Z(0)*Z(0)
420 LET Z(4)=Z(0)/Z(0)
430 LET Z(5)=Z(0)^Z(0)
440 LET A=Z(0)+Z(1)
450 LET Y=-9
460 GOSUB 9000
470 LET A=Z(2)+Z(3)+Z(4)+Z(5)
480 LET Y=15.96296293
490 GOSUB 9000
500 LET A=-2000.00E-03-B(10)-(B(4)-B(7))/2E+1*B(4)^(H9/7)
510 LET Y=-43.5
520 GOSUB 9000
530 FOR I=1 TO 7
540 FOR J=1 TO 7
550 LET Q(I,J)=I/J
560 NEXT J
570 NEXT I
580 LET A=Q(6,3)+Q(6,7)*Q(5,4)*(-Q(2,3))*Q(7,2)/Q(5,6)/Q(3,4)
590 LET Y=-2
600 GOSUB 9000
2000 PRINT
2010 IF F=0 THEN 2040
2020 PRINT "*** TEST FAILED IN ";F;" CASE(S). ***"
2030 GOTO 2050
2040 PRINT "*** TEST PASSED ***"
2050 PRINT
2060 PRINT "                  END TEST"
2070 PRINT
2080 PRINT "END PROGRAM 61"
2090 STOP
9000 REM HANDLE REPORT
9002 REM THIS SUBROUTINE ADOPTS A VERY LOOSE CRITERION OF CORRECTNESS
9004 REM (RELATIVE ERROR < .01). ITS PURPOSE IS NOT TO MEASURE ACCURACY
9006 REM BUT ONLY TO ASSURE THAT THE SEMANTICS OF THE EXPRESSION
9008 REM HAVE BEEN CORRECTLY IMPLEMENTED.
9010 LET C1=C1+1
9020 PRINT C1,Y,A,
9030 LET P$="FAILS"
9040 LET M=0.01
9050 LET T=(A-Y)/Y
9060 IF T>M THEN 9110
9070 LET T=-T
9080 IF T>M THEN 9110
9090 LET P$="PASSES"
9100 GOTO 9120
9110 LET F=F+1
9120 PRINT "TEST ";P$
9130 RETURN
9140 END
