home *** CD-ROM | disk | FTP | other *** search
- R
- FLOATING-POINT BENCHMARK
-
- The following is a program to test the accuracy of floating
- point functions (from Sept. DR DOBBS):
- 10 A=1
- 20 FOR I%=1 TO 2499
- 30 A=TAN(ATN(EXP(LOG(SQR(A*A))))) + 1
- 40 NEXT
- 50 PRINT A
- 60 STOP
-
- The correct printout is A=2500 exactly.
-
- IBM-PC BASIC 1.0 fails miserably, giving A=2179.8 (only 1 sig-
- nificant figure of accuracy!). In contrast, an APPLE II or
- Commodore 64 gives 2500 to at least 7 figures. Using the 8087
- with a polyFORTH version of the benchmark, I obtained 2500 to
- 13 figures in 5.0 seconds. (NOTE: See March,84 D. DOBBS for
- the results aginst many systems.)
-
-
- Press ENTER to continue:
- 13 figures in 5.0 seconds. (NOTE: See March,84 D. DOBBS for
- the results aginst many systems.)
-