Scor­pio News

  

January–March 1987 – Volume 1. Issue 1.

Page 58 of 63
CP/M 2.2CP/M 3.0
COMPAS 48.2 secs 47.1 secs
HP4 8.0 secs 7.9 secs
ProPascal11.5 secs 11.3 secs

Parkinson (1983) utilized a version of a much more rigorous benchmark while testing the HSA-88B High Speed Arithmetic processor. None of the PCW benchmarks tested the accuracy of the particular language/​machine combinations using the intrinsic arithmtic/​trigonometrical functions of BASIC or Pascal, but Parkinson found an excellent test in Duncan (1983) which provides some interesting results. The program used is as follows:

5 REM Benchmark from Dr Dobbs' Journal no. 83 (120-122)
10 NZ=2500
20 A=1
30 FOR IZ=1 TO NZ-1:A=TAN(ATN(EXP(LOG(SQR(A*A)))))+1:NEXT IZ
40 PRINT USING "A = ££££.££££";A

The purpose of the program is to produce a result as close as possible to 2500 in as shore a time as possible. Parkinson produces, results using both compiled and interpreted MBASIC as well as a modified MBASIC. HiSoft HP5 Pascal and a simple assembly language version; the last three were run using the HSA-88B, and all were run at 4MHz.

I used CBASIC, COMAL-80, Pascal and Fortran versions of the program and also tried it out on a UK101 and BBC B (both in its standard version and with the TORCH Z80 processor). The results are shown below, with the MBASIC results for comparison.

MBASIC and Fortran 80 work to 8 digit, ProFortran and ProPascal to 7 digit accuracy in single precision and respectively, to 17 and 14 digit precision when in double precision. COMPAS and COMAL have no double precision facility and work respectively to 11 and 7 digit accuracy. The BBC BASICs (both 6502 and Z80 versions) use 9 digit accuracy.

CP/M 2.2CP/M 3.0
MBASIC(interpreted)2304.86 in 225 secs218 secs
      "(compiled)2304.86 in 183 secs
CBASIC(semi-compiled)2485.76 in 2200 secs*
COMAL-80(interpreted)2407.10 in 89 secs

ProFortran(compiled)2775.50 in 107 secs**103 secs
Fortran 80(       "       )2304.86 in 185 secs**180 secs
COMPAS(       "       )2500.00 in 330 secs**306 secs
HP4(       "       )319.67 in 54 secs!52 secs!
ProPascal(       "       )2772.60 in 106 secs**102 secs

BBC B Basic(interpreted)2499.69 in 310 secs
BBC Z80 Basic(       "         )2498.82 in 188 secs
UK101 8k Microsoft BASIC2506.44 in 301 secs

*14 digit accuracy
**TAN not implemented; user supplied function (SIN/​COS)
!I cannot understand this result at all – any offers?
Page 58 of 63