Small challenge
|
04-24-2023, 01:35 PM
(This post was last modified: 04-24-2023 04:17 PM by J-F Garnier.)
Post: #25
|
|||
|
|||
RE: Small challenge
(04-23-2023 06:41 PM)John Keith Wrote:(04-23-2023 02:13 PM)J-F Garnier Wrote: The implementation of the exponentiation changed between the Capricorn platform (Series 80 / 75C) and the Saturn machines (starting with the 71B).Does anyone know exactly how the code changed and, more importantly, is either implementation generally better than the other? I traced the operations in my Emu75 and Emu71/DOS emulators. First thing I immediately realized is that the HP-75C is using 16-digit extended accuracy for internal calculations, when the Saturn is using only 15 digits, and this explains a lot ! Here are the intermediate results in extended precision on both machines for 3^729, computed as exp(729*ln(3)): 75c (16 digits) 71b (15 digits) ln(3) = 1.098612288668109 1.09861228866810 exact value = 1.098612288668109(69) 729*ln(3) = 800.8883584390514 800.888358439044 exp(729*ln(3)) = 6.628186054237396e347 6.62818605418905e347 rounded to: 6.62818605424e347 6.62818605419e347 Each 71B step is correct, the loss of accuracy comes from the limited guard digits. This confirms my opinion that 3 guard digits are just too short for the exponentiation on large numbers. It was fine for the 10-digit machines with numbers limited to 9.99..E99, but no more for the Saturn. So the question is: why did the Saturn team (well, the initial 71B team) use only 15 digits for internal calculations instead of 16, since both the Capricorn and the Saturn CPUs have 64-bit, i.e. 16-nibble registers? I don't have a clear answer, but managing only 15 digits simplifies the code (adding two 15-digit numbers naturally fits in a 16-digit register) and makes it faster, an important aspect for the quite slow HP-71B. Furthermore, this is how the 41C was doing: internal 13-digit numbers in 14-digit registers. So it was probably a deliberate choice, a trade-off between efficiency and accuracy. J-F |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)