The Museum of HP Calculators

HP Forum Archive 07

[ Return to Index | Top of Index ]

HP y^x Bug?
Message #1 Posted by Eric Evans on 7 Feb 2002, 10:06 p.m.

I have started collecting HP calcs recently, and just obtained a few erlier HP. I have noticed that when I enter y^x functions that it is not calculating them correctly. For instance, if I enter 7^8, it answers 5764800.985 rather than 5764801, 9^3 is 728.9999992 instead of 729. Is this common of the LED HPs? My HP-41C does not exhibit this.

      
Re: HP y^x Bug?
Message #2 Posted by Ellis Easley on 7 Feb 2002, 11:15 p.m.,
in response to message #1 by Eric Evans

I tried your two examples on my calculators with the following results (calculators set to FIX 9 or DSP 9 except the 35):

model      (7^8)            (9^3)
35*        5764800.986      728.9999993
35         5764800.985      728.9999992
45         same                same
25         same                same
65         same                same
67         5764801.000      729.0000000
34C        same                same

*35 with ROM bug

It looks like HP changed the algorithm along the way and finally fixed it. I expect it is just a matter of checking for whole numbers first, to save embarrassment!

            
Re: HP y^x Bug?
Message #3 Posted by Ex-PPC member on 8 Feb 2002, 6:19 a.m.,
in response to message #2 by Ellis Easley

It's not a bug at all, any numerical algorithm is bound to give only a limited precision, as both approximations to trascendental functions (log, sin, etc) and rounding errors caused by finite precision affect the overall accuracy attainable.

HP programmers were fully awara of the situation, and there were several articles in the "HP Journal" dealing with this topic. You may want to read these two:

"Algorithms and Accuracy in the HP-35" "Making 2^3 = 8"

The last one deals with exactly the situation you describe.

      
Re: HP y^x Bug?
Message #4 Posted by Randy Smith on 8 Feb 2002, 11:35 a.m.,
in response to message #1 by Eric Evans

I think that HP went to internal accuracy greater than the display capability of their calculators to prevent things like this from happening. Such as an 11c having a 10 digit display but having 12 digit internal accuracy or something along those lines. Then, the rounding would make the display read the correct answer.

      
Re: HP y^x Bug?
Message #5 Posted by Dave Hicks on 8 Feb 2002, 3:32 p.m.,
in response to message #1 by Eric Evans

When HP calculators first appeared, most science and engineering calculations where done on slide rules which yielded 3-4 digits if you were careful. The early calculators were mostly bought by people who were used to these limits. Besides most real-world measurements that they use in their calculations don't exceed 2 to 4 digits of precision anyway, and scientists understand the concept of significant digits.

I think the drive to more accuracy came mostly when calculators became cheap enough for students. Then calculators became less of an engineering tool and more of a pure math tool and many of the owners got calculators before learning about significant digits and also before learning that floating point numbers are approximations. This lead to improved accuracy and also to the "trick" of calculating more digits than you will allow the user to see. (If the user doesn't like or understand the approximate nature of floating point - hide it.)

By the way, back when "The Pentium Bug" was all the rage, someone reported finding "The Pentium Bug" in the HP-48. He did 1 divided by 3 times 3 and got (gasp!) .999999999999 instead of 1.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall