|
- 10 PRINT "PROGRAM FILE 127: ACCURACY OF SIN FUNCTION."
- 20 PRINT " ANSI STANDARD 7.6, 8.4"
- 30 PRINT
- 40 PRINT "SECTION 127.1: ACCURACY OF SIN FUNCTION."
- 50 PRINT
- 60 PRINT "THIS PROGRAM TESTS VALUES RETURNED BY INVOCATIONS OF THE"
- 70 PRINT "SIN FUNCTION FOR ACCURACY. THE INVOCATION MUST RETURN,"
- 80 PRINT "ACCURATE TO SIX DIGITS, SOME VALUE ACTUALLY TAKEN ON BY"
- 90 PRINT "THE FUNCTION WITHIN A DOMAIN BOUNDED BY THE ACTUAL ARGUMENT"
- 100 PRINT "PLUS OR MINUS ONE IN THE SIXTH DIGIT. ALSO, AN"
- 110 PRINT "'ERROR MEASURE' IS COMPUTED AND REPORTED. THIS MEASURE"
- 120 PRINT "IS JUST 2 * THE ABSOLUTE ERROR OVER THE SIZE OF THE RANGE;"
- 130 PRINT "THUS, A VALUE JUST BARELY PASSING OR FAILING WILL USUALLY"
- 140 PRINT "HAVE A MEASURE OF ABOUT 1. A VALUE 3 TIMES"
- 150 PRINT "AS INACCURATE AS EXPECTED WILL HAVE A MEASURE OF 3."
- 160 PRINT
- 170 PRINT "THIS TEST IS INFORMATIVE ONLY, SINCE THE ANSI STANDARD"
- 180 PRINT "DOES NOT MANDATE ANY ACCURACY FOR SUPPLIED-FUNCTIONS."
- 190 PRINT
- 200 PRINT " BEGIN TEST"
- 210 PRINT
- 220 PRINT "ARGUMENT","TRUE","COMPUTED","ERROR","OUTCOME"
- 230 PRINT " ","VALUE","VALUE","MEASURE"
- 240 PRINT
- 250 LET F=0
- 260 READ A,T,L,H
- 270 IF A=999 THEN 2000
- 280 LET C=SIN(A)
- 290 IF C=T THEN 333
- 300 IF C<L THEN 444
- 310 IF C>H THEN 444
- 320 LET O$=" OK "
- 330 GOTO 500
- 333 LET O$=" OK - EXACT"
- 340 GOTO 500
- 444 LET O$="FAIL"
- 445 LET F=F+1
- 450 GOTO 500
- 500 LET R=H-L
- 510 IF R=0 THEN 700
- 520 LET E=ABS((C-T)/R)
- 525 LET E=E+E
- 530 PRINT A,T,C,E,O$
- 540 GOTO 260
- 700 PRINT A,T,C,"RANGE ZERO",O$
- 710 GOTO 260
- 2000 PRINT
- 2010 IF F=0 THEN 2100
- 2020 PRINT "*** INFORMATIVE TEST FAILED IN ";F;" CASE(S) ***"
- 2030 GOTO 2110
- 2100 PRINT "*** INFORMATIVE TEST PASSED ***"
- 2110 PRINT
- 2120 PRINT " END TEST"
- 2130 PRINT
- 2140 PRINT "END PROGRAM 127"
- 3000 DATA -0.987654000E+05,-0.101562695E-01
- 3010 DATA -0.109934299E+00, 0.897227872E-01
- 3020 DATA -0.987644000E+05, 0.835940129E+00
- 3030 DATA 0.776972770E+00, 0.886555051E+00
- 3040 DATA -0.942682000E+05,-0.999999999E+00
- 3050 DATA -1.000000000E+00,-0.994999665E+00
- 3060 DATA -0.942792000E+04, 0.446577015E-03
- 3070 DATA -0.955328265E-02, 0.104464371E-01
- 3080 DATA -0.942592000E+04,-0.909483178E+00
- 3090 DATA -0.913595542E+00,-0.905279866E+00
- 3100 DATA -0.942949000E+04, 0.999999939E+00
- 3110 DATA 0.999945941E+00, 1.000000000E+00
- 3120 DATA -0.986460000E+03, 0.932271951E-04
- 3130 DATA -0.906773181E-03, 0.109323198E-02
- 3140 DATA -0.999000000E+03, 0.264607527E-01
- 3150 DATA 0.254610398E-01, 0.274604392E-01
- 3160 DATA -0.994314000E+03,-0.999999997E+00
- 3170 DATA -1.000000000E+00,-0.999998922E+00
- 3180 DATA -0.879646000E+02,-0.569948578E-05
- 3190 DATA -0.105699986E-03, 0.943005641E-04
- 3200 DATA -0.990000000E+02, 0.999206834E+00
- 3210 DATA 0.999202347E+00, 0.999211312E+00
- 3220 DATA -0.895354000E+02,-1.000000000E+00
- 3230 DATA -1.000000000E+00,-0.999999494E+00
- 3240 DATA -0.500000000E+02, 0.262374854E+00
- 3250 DATA 0.262277855E+00, 0.262471849E+00
- 3260 DATA -0.200000000E+02,-0.912945251E+00
- 3270 DATA -0.912986555E+00,-0.912903937E+00
- 3280 DATA -0.590000000E+01, 0.373876665E+00
- 3290 DATA 0.373866890E+00, 0.373886440E+00
- 3300 DATA -0.471239000E+01, 1.000000000E+00
- 3310 DATA 0.999999499E+00, 1.000000000E+00
- 3320 DATA -0.314159000E+01,-0.265358979E-05
- 3330 DATA -0.126536398E-04, 0.734641421E-05
- 3340 DATA -0.230000000E+01,-0.745705212E+00
- 3350 DATA -0.745712375E+00,-0.745698049E+00
- 3360 DATA -0.157080000E+01,-1.000000000E+00
- 3370 DATA -1.000000000E+00,-0.999999499E+00
- 3380 DATA -0.120000000E+01,-0.932039086E+00
- 3390 DATA -0.932043210E+00,-0.932034962E+00
- 3400 DATA -0.100000000E+01,-0.841470985E+00
- 3410 DATA -0.841476888E+00,-0.841465081E+00
- 3420 DATA -0.987654000E+00,-0.834736453E+00
- 3430 DATA -0.834737504E+00,-0.834735402E+00
- 3440 DATA -0.765432000E+00,-0.692848571E+00
- 3450 DATA -0.692849793E+00,-0.692847350E+00
- 3460 DATA -0.987654000E-01,-0.986049087E-01
- 3470 DATA -0.986050583E-01,-0.986047592E-01
- 3480 DATA -0.765432000E-01,-0.764684792E-01
- 3490 DATA -0.764686290E-01,-0.764683295E-01
- 3500 DATA -0.975319000E-02,-0.975303537E-02
- 3510 DATA -0.975305038E-02,-0.975302037E-02
- 3520 DATA -0.345678000E-02,-0.345677312E-02
- 3530 DATA -0.345678812E-02,-0.345675811E-02
- 3540 DATA -0.100001000E-02,-0.100000983E-02
- 3550 DATA -0.100002484E-02,-0.999999333E-03
- 3560 DATA -0.100000000E-02,-0.999999833E-03
- 3570 DATA -0.100001484E-02,-0.999989333E-03
- 3580 DATA -0.999999000E-03,-0.999998833E-03
- 3590 DATA -1.000000334E-03,-0.999997333E-03
- 3600 DATA -0.987654000E-04,-0.987653998E-04
- 3610 DATA -0.987655499E-04,-0.987652498E-04
- 3620 DATA -0.917359000E-05,-0.917359000E-05
- 3630 DATA -0.917360500E-05,-0.917357499E-05
- 3640 DATA -0.900000000E-06,-0.900000000E-06
- 3650 DATA -0.900001500E-06,-0.899998499E-06
- 3660 DATA -0.900000000E-09,-0.900000000E-09
- 3670 DATA -0.900001500E-09,-0.899998500E-09
- 3680 DATA -0.900000000E-19,-0.900000000E-19
- 3690 DATA -0.900001500E-19,-0.899998500E-19
- 3700 DATA -0.900000000E-29,-0.900000000E-29
- 3710 DATA -0.900001500E-29,-0.899998500E-29
- 3720 DATA -0.900000000E-37,-0.900000000E-37
- 3730 DATA -0.900001500E-37,-0.899998500E-37
- 3740 DATA 0,0,0,0
- 3760 DATA 0.200000000E-37, 0.200000000E-37
- 3770 DATA 0.199998500E-37, 0.200001500E-37
- 3780 DATA 0.900000000E-29, 0.900000000E-29
- 3790 DATA 0.899998500E-29, 0.900001500E-29
- 3800 DATA 0.900000000E-19, 0.900000000E-19
- 3810 DATA 0.899998500E-19, 0.900001500E-19
- 3820 DATA 0.900000000E-09, 0.900000000E-09
- 3830 DATA 0.899998500E-09, 0.900001500E-09
- 3840 DATA 0.900000000E-06, 0.900000000E-06
- 3850 DATA 0.899998499E-06, 0.900001500E-06
- 3860 DATA 0.917359000E-05, 0.917359000E-05
- 3870 DATA 0.917357499E-05, 0.917360500E-05
- 3880 DATA 0.987654000E-04, 0.987653998E-04
- 3890 DATA 0.987652498E-04, 0.987655499E-04
- 3900 DATA 0.999999000E-03, 0.999998833E-03
- 3910 DATA 0.999997333E-03, 1.000000334E-03
- 3920 DATA 0.100000000E-02, 0.999999833E-03
- 3930 DATA 0.999989333E-03, 0.100001484E-02
- 3940 DATA 0.100001000E-02, 0.100000983E-02
- 3950 DATA 0.999999333E-03, 0.100002484E-02
- 3960 DATA 0.345678000E-02, 0.345677312E-02
- 3970 DATA 0.345675811E-02, 0.345678812E-02
- 3980 DATA 0.975319000E-02, 0.975303537E-02
- 3990 DATA 0.975302037E-02, 0.975305038E-02
- 4000 DATA 0.765432000E-01, 0.764684792E-01
- 4010 DATA 0.764683295E-01, 0.764686290E-01
- 4020 DATA 0.987654000E-01, 0.986049087E-01
- 4030 DATA 0.986047592E-01, 0.986050583E-01
- 4040 DATA 0.765432000E+00, 0.692848571E+00
- 4050 DATA 0.692847350E+00, 0.692849793E+00
- 4060 DATA 0.987654000E+00, 0.834736453E+00
- 4070 DATA 0.834735402E+00, 0.834737504E+00
- 4080 DATA 0.100000000E+01, 0.841470985E+00
- 4090 DATA 0.841465081E+00, 08.41476888E+00
- 4100 DATA 0.120000000E+01, 0.932039086E+00
- 4110 DATA 0.932034962E+00, 0.932043210E+00
- 4120 DATA 0.157080000E+01, 1.000000000E+00
- 4130 DATA 0.999999499E+00, 1.000000000E+00
- 4140 DATA 0.230000000E+01, 0.745705212E+00
- 4150 DATA 0.745698049E+00, 0.745712375E+00
- 4160 DATA 0.314159000E+01, 0.265358979E-05
- 4170 DATA -0.734651521E-05, 0.126536398E-04
- 4180 DATA 0.390000000E+01,-0.687766159E+00
- 4190 DATA -0.687773919E+00,-0.687758399E+00
- 4200 DATA 0.471239000E+01,-1.000000000E+00
- 4210 DATA -1.000000000E+00,-0.999999499E+00
- 4220 DATA 0.590000000E+01,-0.373876665E+00
- 4230 DATA -0.373886440E+00,-0.373866890E+00
- 4240 DATA 0.200000000E+02, 0.912945251E+00
- 4250 DATA 0.912903937E+00, 0.912986555E+00
- 4260 DATA 0.500000000E+02,-0.262374854E+00
- 4270 DATA -0.262471849E+00,-0.262277855E+00
- 4280 DATA 0.895354000E+02, 1.000000000E+00
- 4290 DATA 0.999999494E+00, 1.000000000E+00
- 4300 DATA 0.990000000E+02,-0.999206834E+00
- 4310 DATA -0.999211312E+00,-0.999202347E+00
- 4320 DATA 0.879646000E+02, 0.569948578E-05
- 4330 DATA -0.943005641E-04, 0.105699986E-03
- 4360 DATA 0.994314000E+03, 0.999999997E+00
- 4370 DATA 0.999998922E+00, 1.000000000E+00
- 4380 DATA 0.999100000E+03, 0.734699011E-01
- 4390 DATA 0.724725170E-01, 0.744672117E-01
- 4400 DATA 0.986460000E+03,-0.932271951E-04
- 4410 DATA -0.109323198E-02, 0.906773181E-03
- 4420 DATA 0.942949000E+04,-0.999999939E+00
- 4430 DATA -1.000000000E+00,-0.999945941E+00
- 4440 DATA 0.942592000E+04, 0.909483178E+00
- 4450 DATA 0.905279866E+00, 0.913595542E+00
- 4460 DATA 0.942792000E+04,-0.446577015E-03
- 4470 DATA -0.104464371E-01, 0.955328265E-02
- 4480 DATA 0.942682000E+05, 0.999999999E+00
- 4490 DATA 0.994999665E+00, 1.000000000E+00
- 4500 DATA 0.987644000E+05,-0.835940129E+00
- 4510 DATA -0.886555051E+00,-0.776972770E+00
- 4520 DATA 0.987654000E+05, 0.101562695E-01
- 4530 DATA -0.897227872E-01, 0.109934299E+00
- 9000 DATA 999,0,0,0
- 9400 END
|