10 PRINT "PROGRAM FILE 40: ACCURACY OF SUBTRACTION" 20 PRINT " ANSI STANDARD 7.2, 7.4, 7.6" 30 PRINT 40 PRINT "*** NOTE: THIS PROGRAM MAKES USE OF 'READ' AND 'DATA'" 50 PRINT " 60 PRINT " 70 PRINT " 80 PRINT WHICH HAVE NOT YET BEEN TESTED. IF SUBSEQUENT TESTS SHOW" 100 PRINT "SECTION 40.1 ACCURACY OF SUBTRACTION." 110 PRINT 120 PRINT "THIS SECTION TESTS THE ACCURACY OF SUBTRACTION. THE COMPUTED" 130 PRINT "RESULT IS COMPARED WITH A RANGE ESTABLISHED BY PERTURBING" 140 PRINT "EACH OPERAND BY 1 IN ITS 6TH DIGIT. THE RESULT PASSES IF" 150 PRINT "IT FALLS WITHIN THE EXTREME VALUES GENERATED BY THIS" 160 PRINT "PERTURBATION (ACCURATE TO SIX DIGITS)." 220 PRINT 230 PRINT "THIS TEST IS INFORMATIVE ONLY, SINCE THE ANSI STANDARD" 240 PRINT "DOES NOT MANDATE ANY ACCURACY FOR NUMERIC EXPRESSIONS." 250 PRINT 280 PRINT "FIRST","SECOND","TRUE","COMPUTED","TEST" 310 LET F=0 320 READ A1, A2,T,L, H 330 IF A1=999 THEN 480 335 LET M$="PASS" 340 LET C=A1-A2 350 IF C<L THEN 380 360 IF C>H THEN 380 370 GOTO 400 380 LET M$="FAIL" 390 LET F=F+1 400 PRINT A1,A2,T,C,M$ 410 GOTO 320 480 PRINT 490 IF F=0 THEN 520 500 PRINT "*** INFORMATIVE TEST FAILED IN ";F;" CASE(S) ***" 510 GOTO 530 520 PRINT "*** INFORMATIVE TEST PASSED ***"1 3000 DATA 3010 DATA 3020 DATA 0.876543000E+03,-0.123453000E+03, 0.999996000E+03 0.999993499E+03, 0.999998500E+03 0.811111000E-01,-0.111111000E-01, 0.922222000E-01 3030 DATA 0.922219499E-01, 0.922224500E-01 3040 DATA -0.579999000E+02, 0.111111000E+00, -0.581110110E+02 3050 DATA -0.581111621E+02,-0.581108600E+02 3060 DATA 3070 DATA 3080 DATA 3090 DATA 3100 DATA 3110 DATA 0.111111100E+07,-0.111111100E+07, 0.222222200E+07 0.222219700E+07, 0.222224700E+07 0.654321000E+01,-0.123456000E+01, 0.777777000E+01 0.777774499E+01, 0.777779500E+01 0.654321000E-09,-0.123456000E-09, 0.777777000E-09 0.777774499E-09, 0.777779500E-09 3120 DATA -0.654321000E-19, 0.123456000E-19,-0.777777000E-19 3130 DATA -0.777779500E-19,-0.777774499E-19 3140 DATA 0.654321000E-29,-0.123456000E-29, 0.777777000E-29 3150 DATA 0.777774500E-29, 0.777779500E-29 3160 DATA 3170 DATA 3180 DATA 0.654321000E-37,-0.123456000E-37, 0.777777000E-37 0.777774500E-37, 0.777779500E-37 0.123456000E+11,-0.654321000E+11, 0.777777000E+11 3190 DATA 0.777774500E+11, 0.777779500E+11 3200 DATA -0.123456000E+21, 0.654321000E+21,-0.777777000E+21 3210 DATA -0.777779500E+21,-0.777774500E+21 3220 DATA 0.123456000E+31,-0.654321000E+31, 0.777777000E+31 3230 DATA 0.777774499E+31, 0.777779500E+31 3240 DATA 3250 DATA 3260 DATA 0.123456000E+38,-0.654321000E+38, 0.777777000E+38 0.777774499E+38, 0.777779500E+38 0.499997000E-01,-0.499996000E-01, 0.999993000E-01 3270 DATA 0.999990499E-01, 0.999995500E-01 3280 DATA 0.999993000E-01,-0.400000000E-06, 0.999997000E-01 3290 DATA 0.999995499E-01, 0.999998501E-01 3300 DATA 3310 DATA 3330 DATA 3340 DATA 3350 DATA 3360 DATA 0.999993000E-01,-0.400000000E-07, 0.999993400E-01 0.999991899E-01, 0.999994901E-01 0.999993000E-01,-0.400000000E-08, 0.999993040E-01 0.999991539E-01, 0.999994541E-01 0.999993000E-01,-0.400000000E-09, 0.999993004E-01 0.999991503E-01, 0.999994505E-01 0.999993000E-01,-0.400000000E-10, 0.999993000E-01 3370 DATA 0.999991500E-01, 0.999994501E-01 3380 DATA -0.102030400E+07,-0.400000000E+01,-0.102030000E+07 3390 DATA -0.102031501E+07,-0.102028499E+07 3400 DATA 0.102030400E+07, 0.304000000E+03, 0.102000000E+07 3410 DATA 0.101998499E+07, 0.102001501E+07 3420 DATA -0.102030400E+07,-0.203040000E+05,-0.100000000E+07 3430 DATA -0.100001510E+07,-0.999989400E+06 3440 DATA -0.102030400E+07,-0.102030400E+07, 0.000000000E+00 3450 DATA -0.200000500E+02, 0.200000500E+02 3460 DATA -0.102030400E+00, -0.400000000E-06,-0.102030000E+00 3470 DATA -0.102031501E+00, -0.102028499E+00 3480 DATA 0.102030400E+00, 0.304000000E-04, 0.102000000E+00 3490 DATA 0.101998499E+00, 0.102001501E+00 3500 DATA -0.102030400E+00, -0.203040000E-02,-0.100000000E+00 3510 DATA -0.100001510E+00, -0.999989400E-01 3520 DATA -0.102030400E+00, -0.102030400E+00, 0.000000000E+00 3530 DATA -0.200000500E-05, 0.200000500E-05 3540 DATA -0.102030400E+00, -0.102030300E+00, -0.100000000E-06 3550 DATA -0.210000501E-05, 0.190000500E-05 3560 DATA -0.102030400E+00, -0.102030500E+00, 0.100000000E-06 3570 DATA -0.190000500E-05, 0.210000501E-05 5000 DATA 999,0,0,0,0 5010 END PROGRAM FILE 40: ACCURACY OF SUBTRACTION *** NOTE: THIS PROGRAM MAKES USE OF 'READ' AND 'DATA' SECTION 40.1 ACCURACY OF SUBTRACTION. THIS SECTION TESTS THE ACCURACY OF SUBTRACTION. THE COMPUTED THIS TEST IS INFORMATIVE ONLY, SINCE THE ANSI STANDARD BEGIN TEST 10 PRINT "PROGRAM FILE 41: ACCURACY OF MULTIPLICATION" 20 PRINT " ANSI STANDARD 7.2, 7.4, 7.6" 30 PRINT 40 PRINT "*** NOTE: THIS PROGRAM MAKES USE OF 'READ' AND 'DATA'" 50 PRINT " 60 PRINT " 70 PRINT " 80 PRINT WHICH HAVE NOT YET BEEN TESTED. IF SUBSEQUENT TESTS SHOW" 100 PRINT "SECTION 41.1 ACCURACY OF MULTIPLICATION." 110 PRINT 120 PRINT "THIS SECTION TESTS THE ACCURACY OF MULTIPLICATION. THE " 130 PRINT "COMPUTED RESULT IS COMPARED WITH A RANGE ESTABLISHED BY" 140 PRINT "PERTURBING EACH OPERAND BY 1 IN ITS 6TH DIGIT. THE RESULT" 150 PRINT "PASSES IF IT FALLS WITHIN THE EXTREME VALUES GENERATED BY" 160 PRINT "THIS PERTURBATION (ACCURATE TO SIX DIGITS)." 220 PRINT 230 PRINT "THIS TEST IS INFORMATIVE ONLY, SINCE THE ANSI STANDARD" 240 PRINT "DOES NOT MANDATE ANY ACCURACY FOR NUMERIC EXPRESSIONS." 250 PRINT 280 PRINT "FIRST","SECOND","TRUE","COMPUTED","TEST" 290 PRINT "OPERAND","OPERAND","VALUE","VALUE","RESULT" 300 PRINT 310 LET F=0 320 READ A1, A2,T,L,H 330 IF A1-999 THEN 480 335 LET M$="PASS" 340 LET C=A1*A2 350 IF C<L THEN 380 360 IF C>H THEN 380 370 GOTO 400 380 LET M$="FAIL" 390 LET F=F+1 400 PRINT A1, A2,T,C,M$ 410 GOTO 320 480 PRINT 490 IF F=0 THEN 520 500 PRINT "*** INFORMATIVE TEST FAILED IN ";F;" CASE(S) ***" 510 GOTO 530 520 PRINT "*** INFORMATIVE TEST PASSED ***" 3000 DATA 0.390625000E+01, 0.524288000E+01, 0.204800000E+02 3010 DATA 0.204798585E+02, 0.204801415E+02 3020 DATA 0.646469000E-10, 0.336466000E+11, 0.217514839E+01 3030 DATA 0.217513355E+01, 0.217516322E+01 3040 DATA 0.646469000E-37, 0.336466000E+38, 0.217514839E+01 3050 DATA 0.217513355E+01, 0.217516322E+01 3060 DATA 0.465728000E+00, 0.447578000E+38, 0.208449607E+38 3070 DATA 0.208448193E+38, 0.208451021E+38 3080 DATA 0.348799000E+01, 0.658589000E+37, 0.229715185E+38 3090 DATA 0.229713677E+38, 0.229716692E+38 3100 DATA 0.448588000E+11, 0.888898000E+27, 0.398748976E+38 3110 DATA 0.398747138E+38, 0.398750814E+38 3120 DATA 0.995855000E+19, 0.944647000E+19, 0.940731438E+38 3130 DATA 0.940728997E+38, 0.940733879E+38 3140 DATA 0.995855000E-19, 0.944647000E-18, 0.940731438E-37 3150 DATA 0.940728997E-37, 0.940733879E-37 3160 DATA 0.995855000E-29, 0.944647000E-08, 0.940731438E-37 |