|
- 10 PRINT "PROGRAM FILE 128: ACCURACY OF TAN FUNCTION."
- 20 PRINT " ANSI STANDARD 7.6, 8.4"
- 30 PRINT
- 40 PRINT "SECTION 128.1: ACCURACY OF TAN FUNCTION."
- 50 PRINT
- 60 PRINT "THIS PROGRAM TESTS VALUES RETURNED BY INVOCATIONS OF THE"
- 70 PRINT "TAN 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=TAN(A)
- 285 IF L>H THEN 1000
- 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
- 1000 IF C=T THEN 1333
- 1010 IF C>L THEN 1444
- 1020 IF C<H THEN 1444
- 1030 LET O$="FAIL"
- 1040 LET F=F+1
- 1050 GOTO 1500
- 1333 LET O$=" OK - EXACT"
- 1344 GOTO 1500
- 1444 LET O$=" OK "
- 1445 GOTO 1500
- 1500 PRINT A,T,C,"RANGE SPLIT",O$
- 1510 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 128"
- 3000 DATA -0.987789000E+05,-0.138017476E+01
- 3010 DATA -0.171848904E+01,-0.112416124E+01
- 3020 DATA -0.987654000E+04, 0.724991905E+00
- 3030 DATA 0.709844580E+00, 0.740360468E+00
- 3040 DATA -0.987654000E+03,-0.252646135E+01
- 3050 DATA -0.253386806E+01,-0.251909194E+01
- 3060 DATA -0.987654000E+02,-0.506921050E+01
- 3070 DATA -0.507188654E+01,-0.506653715E+01
- 3080 DATA -0.987654000E+01,-0.485230117E+00
- 3090 DATA -0.485242972E+00,-0.485217262E+00
- 3100 DATA -0.555555000E+01, 0.890667992E+00
- 3110 DATA 0.890649559E+00, 0.890686424E+00
- 3120 DATA -0.471239000E+01, 0.980762048E+06
- 3130 DATA 0.907472194E+05,-0.111353304E+06
- 3140 DATA -0.456789000E+01,-0.687223055E+01
- 3150 DATA -0.687271786E+01,-0.687174330E+01
- 3160 DATA -0.400000000E+01,-0.115782128E+01
- 3170 DATA -0.115784969E+01,-0.115779287E+01
- 3180 DATA -0.314159000E+01, 0.265358979E-05
- 3190 DATA -0.734641521E-05, 0.126536398E-04
- 3200 DATA -0.287654000E+01, 0.271439087E+00
- 3210 DATA 0.271427849E+00, 0.271450324E+00
- 3220 DATA -0.200000000E+01, 0.218503986E+01
- 3230 DATA 0.218497712E+01, 0.218510261E+01
- 3240 DATA -0.161616000E+01, 0.220289470E+02
- 3250 DATA 0.220240353E+02, 0.220338608E+02
- 3280 DATA -0.157081000E+01, 0.731357419E+05
- 3290 DATA 0.422418008E+05, 0.272242309E+06
- 3300 DATA -0.157080000E+01, 0.272241808E+06
- 3310 DATA 0.731356919E+05,-0.158057413E+06
- 3320 DATA -0.157078000E+01,-0.612490085E+05
- 3330 DATA -0.158058414E+06,-0.379840648E+05
- 3340 DATA -0.123456000E+01,-0.286116592E+01
- 3350 DATA -0.286126279E+01,-0.286106906E+01
- 3360 DATA -0.100000000E+01,-0.155740772E+01
- 3370 DATA -0.155744699E+01,-0.155736847E+01
- 3380 DATA -0.876540000E+00,-0.120117664E+01
- 3390 DATA -0.120118408E+01,-0.120116919E+01
- 3400 DATA -0.232323000E+00,-0.236595054E+00
- 3410 DATA -0.236596611E+00,-0.236593498E+00
- 3420 DATA -0.767676000E-01,-0.769187603E-01
- 3430 DATA -0.769189109E-01,-0.769186096E-01
- 3460 DATA -0.234567000E-01,-0.234610030E-01
- 3470 DATA -0.234511531E-01,-0.234608529E-01
- 3480 DATA -0.123456000E-01,-0.123462273E-01
- 3490 DATA -0.123463773E-01,-0.123460772E-01
- 3520 DATA -0.987654000E-02,-0.987686115E-02
- 3530 DATA -0.987687616E-02,-0.987684615E-02
- 3540 DATA -0.345678000E-02,-0.345679377E-02
- 3550 DATA -0.345680877E-02,-0.345677876E-02
- 3560 DATA -0.987654000E-03,-0.987654321E-03
- 3570 DATA -0.987655822E-03,-0.987652821E-03
- 3580 DATA -0.345678000E-03,-0.345678014E-03
- 3590 DATA -0.345679514E-03,-0.345676513E-03
- 3720 DATA -0.900000000E-04,-0.900000002E-04
- 3730 DATA -0.900001503E-04,-0.899998502E-04
- 3740 DATA -0.900000000E-06,-0.900000000E-06
- 3750 DATA -0.900001501E-06,-0.899998500E-06
- 3760 DATA -0.900000000E-09,-0.900000000E-09
- 3770 DATA -0.900001500E-09,-0.899998500E-09
- 3780 DATA -0.900000000E-19,-0.900000000E-19
- 3790 DATA -0.900001500E-19,-0.899998500E-19
- 3800 DATA -0.900000000E-29,-0.900000000E-29
- 3810 DATA -0.900001500E-29,-0.899998500E-29
- 3812 DATA -0.900000000E-37,-0.900000000E-37
- 3814 DATA -0.900001500E-37,-0.899998500E-37
- 3815 DATA 0,0,0,0
- 3816 DATA 0.900000000E-37, 0.900000000E-37
- 3818 DATA 0.899998500E-37, 0.900001500E-37
- 3820 DATA 0.900000000E-29, 0.900000000E-29
- 3830 DATA 0.899998500E-29, 0.900001500E-29
- 3840 DATA 0.900000000E-19, 0.900000000E-19
- 3850 DATA 0.899998500E-19, 0.900001500E-19
- 3860 DATA 0.900000000E-09, 0.900000000E-09
- 3870 DATA 0.899998500E-09, 0.900001500E-09
- 3880 DATA 0.900000000E-06, 0.900000000E-06
- 3890 DATA 0.899998500E-06, 0.900001501E-06
- 3900 DATA 0.900000000E-04, 0.900000002E-04
- 3910 DATA 0.899998502E-04, 0.900001503E-04
- 3920 DATA 0.345678000E-03, 0.345678014E-03
- 3930 DATA 0.345676513E-03, 0.345679514E-03
- 3940 DATA 0.987654000E-03, 0.987654321E-03
- 3950 DATA 0.987652821E-03, 0.987655822E-03
- 3960 DATA 0.345678000E-02, 0.345679377E-02
- 3970 DATA 0.345677876E-02, 0.345680877E-02
- 3980 DATA 0.987654000E-02, 0.987686115E-02
- 3990 DATA 0.987684615E-02, 0.987687616E-02
- 4000 DATA 0.123456000E-01, 0.123462273E-01
- 4010 DATA 0.123460772E-01, 0.123463773E-01
- 4020 DATA 0.234567000E-01, 0.234560030E-01
- 4030 DATA 0.234608529E-01, 0.234611531E-01
- 4040 DATA 0.767676000E-01, 0.769187603E-01
- 4050 DATA 0.769186096E-01, 0.769189109E-01
- 4060 DATA 0.232323000E+00, 0.236595054E+00
- 4070 DATA 0.236593498E+00, 0.236596611E+00
- 4080 DATA 0.876543000E+00, 0.120118397E+01
- 4090 DATA 0.120117652E+01, 0.120119141E+01
- 4100 DATA 0.100000000E+01, 0.155740772E+01
- 4110 DATA 0.155736847E+01, 0.155744699E+01
- 4120 DATA 0.123456000E+01, 0.286116592E+01
- 4130 DATA 0.286106906E+01, 0.286126279E+01
- 4140 DATA 0.157078000E+01, 0.612490085E+05
- 4150 DATA 0.379840648E+05, 0.158058414E+06
- 4160 DATA 0.157080000E+01,-0.272241808E+06
- 4170 DATA 0.158057413E+06,-0.731356919E+05
- 4180 DATA 0.157081000E+01,-0.731357419E+05
- 4190 DATA -0.272242309E+06,-0.422418008E+05
- 4200 DATA 0.161616000E+01,-0.422418008E+05
- 4210 DATA -0.220338608E+02,-0.220240353E+02
- 4220 DATA 0.200000000E+01,-0.218503986E+01
- 4230 DATA -0.218510261E+01,-0.218497712E+01
- 4240 DATA 0.287654000E+01,-0.271439087E+00
- 4250 DATA -0.271450324E+00,-0.271427849E+00
- 4260 DATA 0.314159000E+01,-0.265358979E-05
- 4270 DATA -0.126536398E-04, 0.734641521E-05
- 4280 DATA 0.400000000E+01, 0.115782128E+01
- 4290 DATA 0.115779287E+01, 0.115784969E+01
- 4300 DATA 0.456789000E+01, 0.687223055E+01
- 4310 DATA 0.687174330E+01, 0.687271786E+01
- 4320 DATA 0.471239000E+01,-0.980762049E+06
- 4330 DATA 0.111353304E+06,-0.907472194E+05
- 4340 DATA 0.555555000E+01,-0.890667992E+00
- 4350 DATA -0.890686426E+00,-0.890649559E+00
- 4360 DATA 0.987654000E+01, 0.485230117E+00
- 4370 DATA 0.485217262E+00, 0.485242972E+00
- 4380 DATA 0.987654000E+02, 0.506921050E+01
- 4390 DATA 0.506653715E+01, 0.507188654E+01
- 4400 DATA 0.987654000E+03, 0.253386806E+01
- 4410 DATA 0.251909194E+01, 0.253386806E+01
- 4420 DATA 0.987654000E+04,-0.724991905E+00
- 4430 DATA -0.740360468E+00,-0.709844580E+00
- 4440 DATA 0.987789000E+05, 0.138017476E+01
- 4450 DATA 0.112416124E+01, 0.171848904E+01
- 9000 DATA 999,0,0,0
- 9400 END
|