How Slow Is It?

See all articles from Sinc-Link v5 n4
Author(s): Mel Richardson
Publication: Sinc-Link
Pub Details: Sinc-Link v5 n4 (Volume 5, Issue 4)
Date: July/August 1987
Pages: 3

It has been written many times that Sinclair floating point arithmetic is awfully slow. But it’s accurate! is sometimes exclaimed in defence. Well, just how slow and accurate is it? In the March 87 issue of SKY & TELESCOPE, T.S. Kelso of Austen TX presents a Basic version of a program outlined in BYTE, Vol 10, No. 11, 1985 called the “SAVAGE BENCHMARK“. A Sinclair version is presented below that should be usable on all our machines and provide some interesting comparisons.

The principle of the program is 2499 iterations of three pairs of complementary functions (tan/arctan, exponent/log, square root/square). The number “1” is sent through this grinder and incremented by 1 each time. The correct result of course is 2500 and the computed result will indicate accuracy while the time taken to compute can noted.

Results are given for some computers described as follows: A Z80A system using CPM 2.2 and single precision produced 2304.86 in 4M 20S. Compiled and with double precision gave 2499.999999869949 in 38M 22S and the same system with Turbo Pascal produced 2500.0046341 in 6M 41S. A system with an 8086 processor running at 8mhz using MS-DOS 2.11 produced 2500.004634 in 1M 59S, and with an 8087 numeric processor added gave 2500.00000000118 in 6 seconds. An IBM PC-AT running at 8mhz answered 2500.004634 in 54 seconds. My T/S 1000 in FAST mode with a Z80B produced a respectable 2499.6758 in a modest 15m 29s. There you have it. Not too bad for an unenhanced basic.

For some perspective, it is reported in the same journal that the mighty CRAY X-MP/24 struggled for .7463S to answer 2499.99999999999 etc. Terrific.

   1 REM >SAVAGE BENCHMARK<
5 CLEAR
10 LET A=1
20 FOR I=1 TO 2499
30 LET A=TAN (ATN (EXP (LN (SQR (A*A)))))+1
40 NEXT I
50 PRINT A

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.