The 71B/Turtle and the 49G+/Hare: Results & Comments [LONG] Message #1 Posted by Valentin Albillo on 5 Mar 2004, 1:36 p.m.
Hi all,
As promised a few days ago, these are the compiled results for the original suite of 5 math tests executed in a number of advanced Saturn models, namely HP71B, HP48/49G/49G+, plus two 71B emulators.
All times are in seconds, HP71B code has been included for all tests, and some pertinent comments are given after the results.

 
Test 1: Matrix operations: 
 
 Set up the test by creating a realvalued matrix A with the 
 specified dimensions, and fill it up with different random 
 values between 0 and 1. Then perform the specified matrix 
 operations inplace. 
 
 HP71B setup code: 
 
 OPTION BASE 1 
 N = 10 (or 20, 30, 40) 
 DIM A(N,N) 
 FOR I=1 TO N @ FOR J=1 TO N @ A(I,J)=RND @ NEXT J @ NEXT I 
 
 HP71B code: MAT A = INV(A) 
 MAT A = A*A 
 MAT A = A+A 
 

 Inversion  HP71B  49G+  49G  48GX  Emu71  HP71X 

 10x10  7.5  2.26  4.89  5.2    2.48 
 20x20  57  14.00  28.2  31.5    18.02 
 30x30  185  42.70  82.3  105.5    58.93 
 40x40  432  93.40  185  188.5    136.81 

Multiplicat HP71B  49G+  49G  48GX  Emu71  HP71X 

 10x10  7.3  1.30  2.31  2.4    2.37 
 20x20  57  9.49  17  10.6    18.38 
 30x30  188  30.72  56.4  34.6    61.69 
 40x40  435  70.52  132  131.6  8  145.53 

 Addition  HP71B  49G+  49G  48GX  Emu71  HP71X 

 10x10  0.4  0.24  0.58  0.8    0.15 
 20x20  1.7  1.16  2.95  3.8    0.58 
 30x30  3.7  2.71  7  10.1    1.27 
 40x40  6.7  4.86  12.95  15    2.25 

 
Test 2: Polynomial solver 
 
 Find all roots (both real and complex), of the 100thdegree 
 polynomial equation: 
 
 x^100 + x^99 + x^98 + ... + x^2 + x + 1 = 0 
 
 HP71B setup code: 
 
 OPTION BASE 1 
 COMPLEX R(100) 
 DIM C(101) 
 MAT C = (1) 
 
 HP71B code: 
 
 MAT R = PROOT(C) 
 
 HP71B result verification: 
 
 COMPLEX P @ P=1 
 FOR I = 1 TO 100 @ P = P * R(I) @ NEXT I @ DISP P 
 
 gives (0.999999999944, 1.312E12). The exact value is (1,0) 
 

 Model  HP71B  49G+  49G  48GX  Emu71  HP71X 

 Time  1939  302  533  563  31  597.76 

 
Test 3: Integral & Solve combined 
 
 Find the value of X in [1,2] such that the value of the 
 following integral equals 1/2. We care to get about 
 5 correct decimal places for X (precision = 1E5) 
 
 /X 
  2 
  Sin(x ).dx = 1/2 
  
 /0 
 
 HP71B code: (in radians mode) 
 
 FNROOT(1, 2, INTEGRAL(0, FVAR, 1E5, SIN(IVAR * IVAR))  0.5) 
 
 HP71B result: X = 1.2039153, correct to 8 digits 
 

 Model  HP71B  49G+  49G  48GX  Emu71  HP71X 

 Time  42  19.39  36.35  36.5  0.3  12.81 

 
Test 4: Double integrals 
 
 Compute the following integrals using precision = 1E3 
 
 
 /2 /X 
   
 I1 =   (x + y).dy.dx 
   
 /1 /1 
 
 
 /1 /1 
   x^2*y^2 
 I2 =   e .dy.dx 
   
 /0 /0 
 
 HP71B code: 
 
 10 DEF FNF(X, Y) = X + Y 
 20 DEF FNG(X) = INTEGRAL(1, X, 1E3, FNF(X, IVAR) 
 30 I1 = INTEGRAL(1, 2, 1E3, FNG(IVAR)) 
 and 
 10 DEF FNF(X, Y) = EXP(X * X * Y * Y) 
 20 DEF FNG(X)=INTEGRAL(0, 1, 1E3,FNF(X,IVAR)) 
 30 I2 = INTEGRAL(0, 1, 1E3,FNG(IVAR)) 
 
 HP71B results: 
 
 I1 = 1.50000 (correct to 6 digits) 
 I2 = 1.1351 (correct to 5 digits) 
 

 Integral  HP71B  49G+  49G  48GX  Emu71  HP71X 

 I1  17  3.229  7.36  6    3.44 
 I2  35  9.27  19.22  17.5  1.5  7.39 

 
Test 5: Triple integral 
 
 Compute the following triple integral (precision = 1E3): 
 
 
 /2 /X /X*Y 
    
 I =    (x * y * z).dz.dy.dx 
    
 /0 /0 /0 
 
 HP71B code: 
 
 10 DEF FNF(X, Y, Z) = X * Y * Z 
 20 DEF FNG(X, Y) = INTEGRAL(0, X*Y, 1E3, FNF(X,Y,IVAR)) 
 30 DEF FNH(X) = INTEGRAL(0, X, 1E3, FNG(X, IVAR)) 
 40 I = INTEGRAL(0, 2, 1E3, FNH(IVAR)) 
 
 HP71B results: 
 
 I = 4.0000 (correct to 5 digits) 
 

  HP71B  49G+  49G  48GX  Emu71  HP71X 

  1242  237  550  483  18  252.76 

Notes:
 Results for matrix operations in the 49G/G+/48GX aren't
for operations in place. In place means that the result matrix
is the same as the original matrix, no extra matrix memory is
allocated for the result. That's the case for the featured HP71B code.
 Results for the HP49G/G+ kindly submitted by Arnaud Amiel and
by Doug Rohm, both coincide very closely.
 Results for the HP48GX kindly provided by R. Lion
 HP71X is an HP71B emulator running on HP48/49 hardware.
Here, it has been used in 33.5K RAM configuration with ports 1..3
CLAIMed and port 4 containing the MATH ROM. Times given are
for an HP49G. The times on HP48GX are the same (+/ 0.1 seconds).
HP71X has been developed by HrastProgrammer.
 Emu71 is an HP71B emulator running on Windows systems.
Emu71's tests done on a 2.3GHz Celeron in a Windows2000 Comand Box
in full screen mode, and with Emu71 fast option ('Emu71 /f' command).
Emu71 has been developed by JF Garnier.
 For Test2: Polynomial Solver, the HP71B roots' verification
gives (0.999999999944, 1.312E12), while the HP49G+ gives
(0.999999994031,1.441E12). For the real part, which should be
exactly 1, this means the verifications are correct to 10 and
8 decimal places respectively, i.e.: the later error is 100 times larger.
The HP48GX gives (0.999999994032,2.066E12) , which also has a
100times larger error in the real part, and nearly 2times larger
in the imaginary part.
 To my original question how come the new HP49G+ isn't from 6.5 to 10 times faster than the HP71B, as it should given its underlying hardware and software, Arnaud Amiel offered this plausible explanation:
"The 48/49 have nearly 30 different objects and for each RPL operations the arguments are checked to decide what to do with them. This creates quite some overhead [...] I would think the 71 does not have this overhead. If you look inside of the 49 ROM, you will eventually get to some ASM routines but a lot of sysRPL checking and conditioning of the arguments take place before you get there. [...] As a whole I would think that the main reason why you don't get 6.5 times speed increase would be: argument checking and garbage collection."
I mostly agree with this explanation, but nevertheless I find it quite amazing that such things as argument checking and garbage collection would have such a large impact on performance, as to nearly halve it.
Argument checking, for instance, should be done just once, before the, say, matrix inversion algorithm begins. It can take a second or three, but after that, the inversion procedure proper should take place and consume most of the time. Can't imagine each value being constantly checked while the inversion is taking place. Same goes for garbage collection, it can take some time at the beginning and/or the end of the procedure, but not while the inversion process is running. So, some overhead I would expect, but not nearly as large as 50% of the total time in such a lengthy, complicated calculation.
 Some comparative results between the HP71B and the HP48GX are puzzling to say the least. It seems that the HP48GX can multiply matrices from 3 to 5 times faster than the HP71B, yet it adds them up 3 times slower ! What gives ?
 Both emulators perform extraordinarily well. Emu71's speed has to be seen to be believed, but the sheer portability and takeanywhere character of HP71X makes it a most convenient platform to run your HP71B programs and computations on the move.
Anyway, when all's said and done, I still feel that the HP71B does extraordinarily well against technology 20+ years more advanced. A real tribute to just how incredibly good products they use to design back then in the 'golden age' of HP.
Any and all comments and/or corrections welcome.
Best regards from Valentin Albillo
Edited: 5 Mar 2004, 1:43 p.m.
