Small challenge
|
04-27-2023, 07:31 PM
(This post was last modified: 05-01-2023 08:06 AM by J-F Garnier.)
Post: #34
|
|||
|
|||
RE: Small challenge
To go back to the source of the challenge, the 9825/9835/9845 actually are using a square and multiply method to calculate exponentiation with integer powers.
See the comments in the exponentiation code in this US patent for the 9825 (page 518 of the pdf). Integer power must be understood in the context of these machines as -32768 <= power < 32768 Let's test the example cited in the code comments: HP-9845 Capricorn / Saturn .999^(-32768) = 1.73014224633e14 1.73014224721e14 The Capricorn/Saturn result is exact to 12 digits, but the accuracy of the 9845 doesn't exceed 10 digits (within +/1 ulp) for this test. We can reproduce the 9845's result with this command line on the 75C/71B: >P=.999 @ FOR I=1 TO 15 @ P=P*P @ NEXT I @ X=1/P @ DISP X 1.73014224633E14 This demonstrates that the 9835/9845 didn't use internal extended precision for the exponentiation. Yet the square and multiply method was more accurate than the y^x=exp(x*ln(y)) formula, as demonstrated with 1/(.999^32768) = 1.73014204403e14 computed on the 9845. So no, the 9835 was not more accurate than the Saturn (most of the time) ! It seems the HP-85 (1979) was the first HP desktop to use extended precision for internal calculations, probably using the experience of the accuracy improvement for handheld calculators (HP-22, 1976). J-F (9845 tests conducted on the MAME 9845 emulator). Edit: rephrase "multiplication method" by "square and multiply method." |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)