Message #7 Posted by Valentin Albillo on 2 July 2003, 5:29 a.m.,
in response to message #1 by bill platt
"Just got my copy of a 15C"
First of all, congratulations and welcome to the club !
But let me point out that you didn't get a "copy" of a 15C, but a real, genuine original, right ? There are no copies of 15C's whatsoever, that is until and unless CFKAHP (Company Formerly Known As HP) releases an HP-15C Platinum, Iridium, Praseodimium, or something, though they'll probably release instead a "32SII Platinum" aka 33S.
Now, for the speed issue, this is a very thorny affair, because measuring speed isn't as trival as setting up a loop and timing the seconds it takes to run. There are serious problems with that simple approach, namely:
- The coding of the loop can make all the difference, because a finely tuned loop can run many times faster than a sloppy approach. For instance, you can code a loop in the HP-15C like you did, with that -1, +, x>0? construct, but why not 1, - instead of -1, +, which seems much more natural, or even using the powerful ISG or DSE looping instructions which are provided in the instruction set precisely for that very purpose, or use GTO (i) for rapid reverse branching, thus avoiding the label and the time-consuming label search, or ...
- related to the point above, the best way to code a loop in a particular machine (say a 32S) usually is not the way to code same loop in another one, and here the coder can't usually avoid to incur in language chauvinism or the constructs he/she is used to in another language and/or machine. Only a user absolutely knowledgeable about a number of different machines and who puts aside any preferences on language or coding techniques (say structured vs. goto) can actually produce optimal tests for a given machine or set of machines.
- finally, the very concept of testing the speed using a simple loop is as misleading a concept as one can be. There are machines that will run a 1000-cycle loop blidingly fast, yet will choke to death upon encountering a floating point sine computation, not to mention doing it properly (range, accuracy, etc).
The HP-15C is optimized for mathematical computations, not branching and looping, and at that it excels. Its instruction set includes functions to do almost all things mathematical with as little looping as possible.
If you study my past HP-15C Quizs/Challenges, you will see that the matrix operations, for instance, are so powerful that you can do without loops many computations that seemed to require them, and even when loops are needed, they can be kept to a bare minimum.
In other words, if you want to make a fair speed comparison and learn something about the relative speed of machines, avoid coming to premature conclusions by resorting to the use of an inadequate, quick & dirty test. I'd suggest the following instead:
Run a test which does significant computation, using a lot of mathematical functions [which is what a calculator such as the HP-15C is optimized to do], operators, storage, etc, and little branching. You should strive for a 90% computing, 10% branching or less. See what figures you get then. I'll bet you won't get a 19:1, right ?
If really trying to asses the speed of the HP-15C in particular, try to solve a 7x7 linear equations system in both your 15C and your 32S, and compare the times. See ?
Of course the 32S doesn't have matrix operations but so what ? That's not the 15C's fault, and we're testing speed in solving real-life math problems, aren't we ? ;-)
Matter of fact, I've done computations on my HP-15C, in 40+ steps, in a few seconds, that you wouldn't even dream of doing on a 32S, in 200+ steps, in many minutes [see my Datafile article next month], that is, if you could attempt them, which you can't because they won't fit. A comprehensive, well thought, awesomely powerful instruction set more than makes for lack of speed in other areas.
That said, welcome again and enjoy to the max your HP-15C. And I fully expect that you'll post a solution to my next HP-15C Quiz/Challenge, to be posted in a few days, you have that much time to learn all the capabilities of your wonderful machine, lest it becomes painfully obvious you simply don't deserve to own one. Do not try it with your 32S, though, it won't work :-)
Edited: 2 July 2003, 5:31 a.m.