The Museum of HP Calculators

HP Forum Archive 13

[ Return to Index | Top of Index ]

Algorithmically refined...
Message #1 Posted by eclectic_echidna on 27 Aug 2003, 7:39 p.m.

A recent post had this in it:

> the HP15C is a very algorithmically refined calculator

Later they lead me to believe that they would love it if those "special" algorithms would be perfect for use on a PDA. The HP15C algorithms are refined for its particular processor, memory size, and battery.

In this day and age of 200-400MHZ pocket PCs, wouldn't a more appropriate algorithm be one that utilizes modern day strengths, speed and memory size?

Wouldn’t an arbitrary precision floating point package linked with appropriate transcendental algorithms provide superior computation?

Am I missing something?

Edited: 27 Aug 2003, 7:40 p.m.

      
Re: Algorithmically refined...
Message #2 Posted by Randy Sloyer on 27 Aug 2003, 8:04 p.m.,
in response to message #1 by eclectic_echidna

Quote:
Am I missing something?
IMO, yes you are.

The algorithms already exist in Saturn machine code. Why re-write them for the processor du jour? Don't monkey with hand-tuned assembler. Any idea of how many man-years that code represents?

Quote:
Wouldn’t an arbitrary precision floating point package linked with appropriate transcendental algorithms provide superior computation?

Nope. Far better in BCD despite the speed loss. Just write an emulator for the processor, a far easier thing to do than starting to muck with proven algorithms.

            
Re: Algorithmically refined...
Message #3 Posted by Jonas Lööf on 28 Aug 2003, 11:58 a.m.,
in response to message #2 by Randy Sloyer

I would take IEEE binary floating point over BCD any time. Except when doing financial calculations, wich I never use a calcualtor for, the inability to exactly represent decimal fractions is not inportant. Proper rounding behaviour is specified in the (IEEE) standard; my guess is that common IEEE implementations are every bit as well tested as the HP BCD, despite beeing newer. When doing scientific computations there is absolutely no reason whatsoever to use BCD.

      
Re: Algorithmically refined...
Message #4 Posted by Nelson M. Sicuro (Brazil) on 27 Aug 2003, 8:05 p.m.,
in response to message #1 by eclectic_echidna

This is the same thinking of the M$ people, "why do we need to refine our algorithms if the CPU is fast enough? If it wasn't fast enough, let the user buy a faster CPU!" As a programmer, I think that refined algorithm is that "plus" (= quality) of some product.

Regards,

Nelson

            
Re: Algorithmically refined...
Message #5 Posted by Bill Wiese on 27 Aug 2003, 9:16 p.m.,
in response to message #4 by Nelson M. Sicuro (Brazil)

A lot of thought went into Solve & Integrate. (Apparently Wm. Kahan of floating-point math fame was deeply involved.)

There's more than just coding involved here: the parameters of these algorithms, search ranges, etc were prob more carefully chosen than for other calcs. This was at the peak of HP's calc dominance (in terms of quality/market positioning/etc.) and where HP would spend $$$ to differentiate from low-end competitors.

Of course these functions could be written better w/more memory, etc. But we DO know the limits of the 15C, bugs, etc. - we've had 15+ years now. Hell, doesn't the 15C even have its own Advanced Functions book?

If we want a 15C on a Palm-type unit, why not just emulate more than the keyboard layout? Start w/an exact match and improve - no more 12C Platinum debacles!

Bill

            
Well said...
Message #6 Posted by Pierre Brial on 28 Aug 2003, 6:08 a.m.,
in response to message #4 by Nelson M. Sicuro (Brazil)

Well said Nelson. I am happy there are still some guys who think like this. The lack of research of refined algorithms in modern programming is the reason why, despite having more and more power, modern computer are slower and slower to boot. Happy programming Pierre

      
Re: Algorithmically refined...
Message #7 Posted by Valentin Albillo on 28 Aug 2003, 4:18 a.m.,
in response to message #1 by eclectic_echidna

You posted:

"Am I missing something ?"

Indeed you are. But it's not easy to explain it in a few lines, nor is this exactly the proper place to do it.

If you really want to know and understand what you're missing, just get a copy of the HP-15C Advanced Functions manual, either spiral-bound for easy reading or in CD, and read it carefully. You don't need to have an HP-15C at hand to make the most of this wonderful book, which is more a treatise on accuracy and the techniques to achieve it than a 15C-only manual.

I'm pretty sure you'll be amazed at the many traps and pitfalls lurking out there when implementing sophisticated algorithms, and the ultra-clever ways in which HP engineers and consultants of the time (most notably Mr. Kahan who is a world-class authority on the subject) managed to succeed, thus making the HP-15C the very best pure calculator in the world, bar none.

Best regards from V.

P.S.: And don't let "multiprecision" computations fool you. I do own a vintage Sharp PC-1475, which can do computations in double precision (20 decimal digits) and believe me, it doesn't hold a candle next to the "13-digit internal precision of the HP-15C + the best possible algorithms" bundle. If you trust it blindly you'll end up with 20 digits, yes, but they might be 7-digits correct + 13-digits garbage, for all you know.

Edited: 28 Aug 2003, 4:20 a.m.

            
Re: Algorithmically refined...
Message #8 Posted by Pierre Brial on 28 Aug 2003, 6:08 a.m.,
in response to message #7 by Valentin Albillo

Hello Valentin,

I also own some Sharp pocket computers (including PC-1475) and I like them as much as my HPs, for their quality and usefullness. But I never tested them to compare with Hp about accuracy. Do you have some examples of calculations where the double precision PC-1475 could give less accurate results than the HP-15C ?

All the best

Pierre

                  
Re: Algorithmically refined...
Message #9 Posted by Valentin Albillo on 28 Aug 2003, 6:23 a.m.,
in response to message #8 by Pierre Brial

Hi Pierre,

Pierre posted: "I also own some Sharp pocket computers (including PC-1475) and I like them as much as my HPs, for their quality and usefullness."

Exactly same here, I do own a large collection of Sharp PC pocket computers and they are every bit as good, if not better, than HP vintage handhelds, not to mention newer models.

"But I never tested them to compare with Hp about accuracy. Do you have some examples of calculations where the double precision PC-1475 could give less accurate results than the HP-15C ?

Yes, try the determinant or matrix inversion built-in functions of the Sharp PC-1475 versus the equivalent HP-15C ones when applied to Hilbert matrices of orders 5,6,7, etc. Just in case you've never seen Hilbert matrices before, have a look at this PDF document:

Hilbert matrices

Best regards from V.

                        
Re: Algorithmically refined...
Message #10 Posted by Pierre Brial on 30 Aug 2003, 2:06 a.m.,
in response to message #9 by Valentin Albillo

Hello Valentin It seems that with Sharp PC the double precision is only available in RUN mode, and not in CALC or MATRIX. So matrix calculation are made with only 10 digits accuracy. I see recently in the local library a book about calculator use at school where they give some examples of simple calculations which give wrong results. I will look at this and try some tests on my machines. Cheers Pierre

      
Re: Algorithmically refined...
Message #11 Posted by Grant Goodes on 28 Aug 2003, 11:23 a.m.,
in response to message #1 by eclectic_echidna

Quote:
In this day and age of 200-400MHZ pocket PCs, wouldn't a more appropriate algorithm be one that utilizes modern day strengths, speed and memory size?

This is what I personally call the "Micro$oft Falacy": The delusion that problems are always better solved by a bigger box with (apparently) fancier software. In fact, as soon as you enter the realm of mathematics, rigour is more important than marketing, and "modern day strengths" as you call them, are but sirens singing you onto the rocks. The fact that this falacy sells more mother-boards/hard-drives/memory etc., is the explanation of why it is so pevasive, but that's another thread.

I would claim that having a heavily constrained platform to develop your algorithms on (say an 8-bit processor and 4k of memory) almost always results in better code than the bottomless memory/GHz pit of a modern PC. You end up having to think, and the tough constraints necessitate that the algorithm must be thoroughly understaood.

I hate to belabour the point (a lie: Actually I love to belabour this particular point), but the vast computing resources available to the average "modern" programmer means that few ever really bother to write anything more than a first hack at an algorithm, go through a cycle of bug-fixing, and release it to the unwitting customers. With a limited platform, coding inevitably goes through a cycle of think/write/refine/repeat. I don't think too many people would apply the word "refined" to the SW out of Redmond, but the HP-15C? Now there's refined!

I usually draw the analogy of the piano versus the syntesizer: Much music written for the piano (in some respects, the first "universal" musical instrument, much like a microprocessor is a universal calculating device) is far superior to that written for the far more flexible synthesizer (flexible in the sense that it can make basically any sound). The very versatility of the synthesizer ensnares many musicians in a net of infinite possibilities, most of which just sound bad. The extremely limiting constraints of the piano seem to result in a purity of form that often inspires the composer to greater art.

Just rambling now, I guess, so I'll shut up.

grant..

            
Re: Algorithmically refined... clarification on what I meant...
Message #12 Posted by Bill Wiese on 28 Aug 2003, 1:50 p.m.,
in response to message #11 by Grant Goodes

Before we really get into whose calcs are better at ln(x) or arctan(x), etc. I want to say I was NOT just referring to the basic accuracy of transcendentals & other funcs.

I was more referring to the elegant Solve & Integrate functions - which, BTW, were nicely done on the HP34C also.

Just because your formula to evaluate is calculated accurately to the Nth digit DOESN'T mean that a given iterative algorithm is suitable, stable, or will even find a root in a troublesome region!

I do think HP thought a lot about the transcendentals as they went on developing calcs - remember, they even included LN(1+x) and e^(1+x) functions for x values close to zero on the 41C, 42S (and maybe others).

I thought it was way cool when the 11C/15C were introduced (I was a Sr in high school) and they had the Gamma function! I'd spent a merry prev summer dealing with log(gamma(x)) on my TI58 and exploring "big factorials".

Bill Wiese San Jose, CA

      
Re: Algorithmically refined...
Message #13 Posted by hugh steers on 28 Aug 2003, 2:45 p.m.,
in response to message #1 by eclectic_echidna

although i agree with the other replies, there is a point here. a question i often ask myself is, whats now possible with 50-500MHz pocket devices, PDA or otherwise.

i was impressed by hps attempts to tackle symbolic calculation and would have liked to have seen this technology improve in their future calculators. it would have make proper use of more speed & memory.

the kinpo offerings meant two things to me. firstly that hp (amazingly) were chucking away those algorithms that had been refined, and secondly, that use of elementary algorithms translated to cheap chips.

the new range will be interesting. do they run their old algorithms or are they new like on the 12CP where we've seen real novice tvm results. i suppose they'll be flash upgradeable. i can see it now: hp49II sp1a.

on the subject of bcd. i am now convinced that we're seeing a phase change in the calculator industry where all units will go over internally to binary due to the availability of cheap, working fp cores. numerically, this will be interesting.

            
Re: Algorithmically refined... Matlab
Message #14 Posted by Bill Wiese on 28 Aug 2003, 3:54 p.m.,
in response to message #13 by hugh steers

Umm many PDAs now have enough horsepower to run at least a small version of Matlab.

While a calc is great for playing w/numbers, Matlab is great for playing with "sets of numbers". That along w/an integrated Maple symbolic engine would be very nice - though a handheld-appropriate UI might be necessary.

Yes, IEEE FP is prob better overall for math stuff than BCD FP. However remember HP calcs were 'do all' consumer products and they didn't want people to be puzzled why 3*(1/3) = 9.99999999999 instead of 10.

Bill Wiese San Jose, CA

                  
Re: Algorithmically refined... Matlab
Message #15 Posted by W. Bruce Maguire II on 28 Aug 2003, 5:25 p.m.,
in response to message #14 by Bill Wiese

Quote:
...However remember HP calcs were 'do all' consumer products and they didn't want people to be puzzled why 3*(1/3) = 9.99999999999 instead of 10.

Bill Wiese San Jose, CA


Bill:

Did you use one of the "new" HP calc.s for that 3*1/3 = 10 example?

;-)
Bruce.
                        
Re: Algorithmically refined... ooops!
Message #16 Posted by Bill Wiese on 28 Aug 2003, 6:26 p.m.,
in response to message #15 by W. Bruce Maguire II

whoops, yes, "10" should indeed have a dec. pt, 3x(1/3)=1.0

Bill

                  
Re: Algorithmically refined... Matlab
Message #17 Posted by Daniel Diggelmann on 28 Aug 2003, 5:30 p.m.,
in response to message #14 by Bill Wiese

Yes Bill, I agree with you. I have a HP 200LX running MATLAB 3.5 for DOS on it. MATLAB is great for vectors and matrices. The 200LX screen allows highres plots. MATLAB includes proven algorithms which are very stable. If I need a symbolic CAS DERIVE 3.14 for DOS is good for me. Actually I like the HP 200LX very much as it is very small and can run a great choice of APPS. The keyboard might be a bit small though to enter large amounts of numbers.

Cheers Daniel

                  
Re: Algorithmically refined... Matlab
Message #18 Posted by Rodger Rosenbaum on 31 Aug 2003, 7:45 p.m.,
in response to message #14 by Bill Wiese

Bill Wiese says: "Yes, IEEE FP is prob better overall for math stuff than BCD FP."

There is an IEEE floating point standard for radix-independent math. "Radix-independent" includes BCD math, and the HP71B was designed to adhere to the IEEE BCD floating point standard as it existed at the time. Thus, in the HP71B, IEEE FP is not different from BCD FP. The later calcs using the Saturn have the same basic algorithms, minus some of the niceties like NaN's, infinities, signed zero, etc. So, IEEE (binary) FP may be better than the BCD math in "other" brands of calculators, but the Saturn based calcs are doing IEEE BCD math. That's why they're so good.

                        
Re: Algorithmically refined... Matlab
Message #19 Posted by Sean on 1 Sept 2003, 1:18 a.m.,
in response to message #18 by Rodger Rosenbaum

I have both Derive and Matlab on my Hp200LX - Cool as HE with two toothpicks!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall