Post Reply 
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
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Small challenge - J-F Garnier - 04-22-2023, 02:33 PM
RE: Small challenge - Valentin Albillo - 04-22-2023, 03:29 PM
RE: Small challenge - John Keith - 04-22-2023, 04:38 PM
RE: Small challenge - Massimo Gnerucci - 04-22-2023, 03:33 PM
RE: Small challenge - Valentin Albillo - 04-22-2023, 03:41 PM
RE: Small challenge - J-F Garnier - 04-22-2023, 03:41 PM
RE: Small challenge - Gerson W. Barbosa - 04-22-2023, 05:15 PM
RE: Small challenge - BruceH - 04-22-2023, 04:30 PM
RE: Small challenge - Gerson W. Barbosa - 04-22-2023, 05:29 PM
RE: Small challenge - Gerson W. Barbosa - 04-28-2023, 12:52 AM
RE: Small challenge - J-F Garnier - 04-28-2023, 07:13 AM
RE: Small challenge - J-F Garnier - 05-16-2023, 06:57 PM
RE: Small challenge - robve - 05-18-2023, 03:16 AM
RE: Small challenge - C.Ret - 04-22-2023, 06:30 PM
RE: Small challenge - Thomas Klemm - 04-22-2023, 07:24 PM
RE: Small challenge - J-F Garnier - 04-22-2023, 09:42 PM
RE: Small challenge - Guenter Schink - 04-25-2023, 09:56 PM
RE: Small challenge - John Keith - 04-25-2023, 11:46 PM
RE: Small challenge - Dave Britten - 04-27-2023, 02:30 PM
RE: Small challenge - Valentin Albillo - 04-23-2023, 12:58 AM
RE: Small challenge - C.Ret - 04-23-2023, 06:24 AM
RE: Small challenge - EdS2 - 04-23-2023, 08:00 AM
RE: Small challenge - robve - 04-23-2023, 11:10 AM
RE: Small challenge - robve - 04-23-2023, 01:01 PM
RE: Small challenge - robve - 04-23-2023, 01:56 PM
RE: Small challenge - EdS2 - 04-23-2023, 02:08 PM
RE: Small challenge - J-F Garnier - 04-23-2023, 02:13 PM
RE: Small challenge - John Keith - 04-23-2023, 06:41 PM
RE: Small challenge - J-F Garnier - 04-24-2023, 10:11 AM
RE: Small challenge - Albert Chan - 04-24-2023, 12:58 PM
RE: Small challenge - brouhaha - 04-24-2023, 05:32 PM
RE: Small challenge - Albert Chan - 04-24-2023, 01:07 PM
RE: Small challenge - robve - 04-28-2023, 08:37 PM
RE: Small challenge - J-F Garnier - 04-24-2023 01:35 PM
RE: Small challenge - John Keith - 04-24-2023, 06:54 PM
RE: Small challenge - Christoph Giesselink - 04-25-2023, 07:13 PM
RE: Small challenge - J-F Garnier - 04-25-2023, 08:49 PM
RE: Small challenge - J-F Garnier - 04-26-2023, 07:51 AM
RE: Small challenge - J-F Garnier - 04-27-2023, 07:31 PM
RE: Small challenge - EdS2 - 04-28-2023, 08:53 AM



User(s) browsing this thread: 2 Guest(s)