Post Reply 
Did you know the 2nd bathch of Spice calculators are more accurate?
05-17-2023, 04:29 PM (This post was last modified: 05-17-2023 04:29 PM by zeno333.)
Post: #1
Did you know the 2nd bathch of Spice calculators are more accurate?
In the HP-15C Advanced Functions Handbook, it details the issues with the accuracy of 3 raised to the 201 power. The first launch of Spice HP calculators in May, 1st, 1978, the 31E and the 33E get the answer of 7.968419661 E 95. The 32E that came out on July 1st, 1978 gets an answer of 7.968419664 E95. the correct answer would be 7.968419666 E95. This shows that there was a change in algorthims used from may 1st, to July 1st, 1978, and the later 32E is a little bit more accurate and closer to the correct result.
Find all posts by this user
Quote this message in a reply
05-17-2023, 05:03 PM
Post: #2
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
Both the original HP15c and the newest HP15c Collector's Edition have the same value of 7.968419664 e95 as the newest version of Spices.

Speed of both is very different even for such a short calculation. Not that it matters - in any case it is just over 1 second+
Find all posts by this user
Quote this message in a reply
05-17-2023, 08:18 PM (This post was last modified: 05-17-2023 09:20 PM by J-F Garnier.)
Post: #3
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
(05-17-2023 04:29 PM)zeno333 Wrote:  ... the accuracy of 3 raised to the 201 power. The first launch of Spice HP calculators in May, 1st, 1978, the 31E and the 33E get the answer of 7.968419661 E 95. The 32E that came out on July 1st, 1978 gets an answer of 7.968419664 E95. the correct answer would be 7.968419666 E95.

The main change regarding accuracy, and especially the y^x function, took place with the HP-22 (see here for instance).
Before the HP-22, the result of 3^201 was much worse;
e.g on a HP-45: 3^201 = 7.968420280 E 95

I didn't remember it, but you're right, I just double checked on a few machines I have on hand, there is indeed a smaller improvement in the HP-32E and later machines:
67 29C 31E 33E : 7.968419661 E 95
32E 34C : 7.968419664 E 95

I can't remember if it has been discussed already in this forum, it may be but I can't find any reference right now.

It would be interesting the trace the execution on both a 31E and 32E to identify the change.
It may be an improvement of the LN function.


Edit: I found this post of mine highlighting the difference between a 33E and a 41C.
A little downward in the thread, I wrote:

(04-03-2022 02:33 PM)J-F Garnier Wrote:  I know it since only recently when I tried to run this test on the 33E and the 41C.
BTW, the 34C has the same improvement (for the 3^201 test) as the Voyager and the 41C.
But I really would like to know more

Only one year ago, I just vaguely remembered it...
Yet I still would like to know more.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2023, 11:51 AM (This post was last modified: 05-18-2023 11:58 AM by Gil.)
Post: #4
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
With HP49-HP50 in exact mode:

'3^201' 796841966627624308016343966107338880487700357960183487923724885217277472703906548983154097132​003

'3.^201' 7.96841966626 E95

« 3. 1 200
START 3 *
NEXT
» 7.96841966622 E95

'EXP(LN(3)*201)'
7.9684196 7193 E95

ALOG(LOG(3)*201)' 7.9684196 6716 E95

e powers and ln (base e) seen to give worse results than when working with 10^ and log(base 10).
Find all posts by this user
Quote this message in a reply
05-18-2023, 12:37 PM (This post was last modified: 05-18-2023 12:41 PM by J-F Garnier.)
Post: #5
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
(05-18-2023 11:51 AM)Gil Wrote:  'EXP(LN(3)*201)'
7.9684196 7193 E95

This is equivalent to compute the exponentiation without guard digits, as did the early HP handhelds.

Quote:« 3. 1 200
START 3 *
NEXT
» 7.96841966622 E95

Here, not only you are calculating without guard digits, but you are cumulating rounding errors.

Quote:ALOG(LOG(3)*201)' 7.9684196 6716 E95

e powers and ln (base e) seen to give worse results than when working with 10^ and log(base 10).

Globally, when calculating without guard digits and results of this magnitude, the last 3 digits are not reliable, and the two results are about equally correct (or wrong).

You may also try the test 3^729, that is better adapted to the 12-digit Saturn machines (see here):
3^729 =                  6.62818605419 E 347
EXP(729*LN(3)) =     6.62818606053 E 347
ALOG(729*LOG(3)) = 6.62818605986 E 347
exact  =                  6.62818605424(187) E 347

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2023, 11:36 PM
Post: #6
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
The Spice models included a 1024x10 ROM, and the LED anode and cathod drivers, in their CPU chips, providing a cost reduction compared to the Woodstock series. The CPU ROM was intended to be common code shared by multiple calculator models, so there are only three main CPU versions rather than eight. The CPU ROMs mostly contain the arithmetic and transcendental function microcode.

1820-2105 (optional -A or -B suffix, also may be referenced as 00031-80003 or 1MA4-0001) was used in the 31E, 33E, and 33C.

1820-2122 (optional -A suffix, also may be referenced as 00037-80001 or 1MA4-0002) was used in the 37E and 38E.

1820-2162 (optional -A suffix, also may be referenced as 00032-80001 or 1MA4-0003) was used in the 32E, 34C, and 38C.

Improvements to the accuracy would most likely have been in the 1820-2162, thus affecting the 32E, 34C, and 38C.

I have not determined whether there are any code differences between corresponding no-suffix, -A suffix, and -B suffix parts.
Find all posts by this user
Quote this message in a reply
05-19-2023, 08:08 AM
Post: #7
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
Thanks Eric for the information, so it makes sense that the 32E and 34C have the same improvement. I don't own a 38C so can't check.
BTW, I didn't know that the 38E and 38C have different firmware, contrary to the 33E/33C.
Maybe the accuracy improvement was regarded as important enough for financial models to justify a firmware upgrade.
Do we know if there are other functional changes in the 38C compared to the 38E?

On my side, I traced the code and recorded the intermediate 13-digit results for 3^201 = exp(201*ln(3)), on the 33E and 41C:
(using the multicalc emulator and my emu41 respectively - sorry Eric, can't run Nonpareil on my W11 machine ;-)

                             HP-33E                  HP-41C
ln(3) =              1.098612288665        1.098612288667       (exact: 1.098612288668)
201*ln(3) =        220.8210700216        220.8210700220       (correct truncated values)
exp(201*ln(3)) = 7.968419660804e95   7.968419663994e95   (should be: 7.968419660777e95 and 7.968419663965e95 resp.)
rounded to :       7.968419661e95        7.968419664e95

The difference is all due to the slightly better LN result, by 2 units in the 13th place that propagate to 3 units in the 10th place in the final rounded result.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
05-19-2023, 10:46 PM
Post: #8
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
(05-19-2023 08:08 AM)J-F Garnier Wrote:  can't run Nonpareil on my W11 machine ;-)

A bit off topic here (apologies) but using wsl2 you should be able to run a Linux version. I'd attach a screenshot but I just rebuilt my Windows 11 laptop as a Debian 11 box.

Mike T.

HP21, HP25, HP32E, HP33C, HP34C, HP10C, HP11C, HP12C, HP32S, HP22S
Find all posts by this user
Quote this message in a reply
05-20-2023, 02:56 AM
Post: #9
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
The Windows version of Nonpareil runs just fine on Windows 11 too.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-20-2023, 05:46 AM
Post: #10
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
(05-20-2023 02:56 AM)Eric Rechlin Wrote:  The Windows version of Nonpareil runs just fine on Windows 11 too.

If you're talking about the Windows build of Nonpareil that I released many years ago, it is very dated, so it doesn't have a lot of the more recent bug fixes, and supports a rather limited set of calculator models. With regard to the 30 series (Spice), it's missing the 31E and 33E, though it does have the 33C.

I'm still hoping to get a new release of Nonpareil built for Windows, but it's a fair bit of work.

Long term the plan is for Nonpareil to switch toolkits from GTK2 to Qt6, which should be much more maintainable, but that switch is also a lot of work.
Find all posts by this user
Quote this message in a reply
05-20-2023, 06:21 AM
Post: #11
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
(05-19-2023 08:08 AM)J-F Garnier Wrote:  BTW, I didn't know that the 38E and 38C have different firmware, contrary to the 33E/33C.

The 33E and 33C have different firmware. They share the same CPU (1820-2105), so the first 1K of microcode is identical, and is mostly the arithmetic routines. The next 512 words are in different ROM chips, but have identical content (addresses octal 2000 to 2777). Because the ROM chips store 1K or more, they couldn't use the same chips for that region. The rest of the microcode is similar, but not identical. I haven't yet analyzed all of the changes, but they added detection for "Pr Error", so I expect they must have added use of a cold-start constant in RAM somewhere. There are some changes to the init routine starting at octal 3002, amd new code starting at 7000 does most of the work.

The 38E and 38C microcode are much different. Both ROM and RAM are substantially rearranged. It's possible that much of the code is actually the same, but because everything moved around, it's not trivial to discern.
Find all posts by this user
Quote this message in a reply
05-20-2023, 09:00 AM
Post: #12
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
(05-20-2023 06:21 AM)brouhaha Wrote:  
(05-19-2023 08:08 AM)J-F Garnier Wrote:  BTW, I didn't know that the 38E and 38C have different firmware, contrary to the 33E/33C.

The 33E and 33C have different firmware.
[..] they added detection for "Pr Error", so I expect they must have added use of a cold-start constant in RAM somewhere.

Oh yes, I should have thought about the "Pr Error" message, definitively a firmware difference.

I probably confused with the 25/25C.
The 25C doesn't have a RAM check or "Pr Error" message and so uses the same ROM as the 25, correct?
In this small booklet , there is a specific procedure for the 25C to initialize the RAM in case of power disruption.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
05-20-2023, 08:55 PM
Post: #13
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
(05-20-2023 09:00 AM)J-F Garnier Wrote:  I probably confused with the 25/25C.
The 25C doesn't have a RAM check or "Pr Error" message and so uses the same ROM as the 25, correct?
In this small booklet , there is a specific procedure for the 25C to initialize the RAM in case of power disruption.

Yes. There are two released versions of the 25 microcode, the later incorporating some bug fixes. The 25C always used the newer 25 microcode, but did not have any specific support for detecting power loss or memory loss. I'm guessing that they didn't want to add a third ROM for that.
Find all posts by this user
Quote this message in a reply
05-21-2023, 08:30 AM
Post: #14
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
I checked the result of 3^201 on more Spice models.
33C: 7.968419661 E 95 no accuracy improvement
37E, 38E : 7.968419664 E 95 with the improvement
Checked on both multicalc and nonpareil, a confirmation on the real machines is welcome.

The HP-38E seems to be the first with the accuracy improvement, although it was introduced at the same time as the HP-31E and 33E that don't have it.

BTW, it's a challenge to display the mantissa of 3^201 on the 37E...

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
05-21-2023, 06:29 PM
Post: #15
RE: Did you know the 2nd bathch of Spice calculators are more accurate?
(05-21-2023 08:30 AM)J-F Garnier Wrote:  I checked the result of 3^201 on more Spice models.
33C: 7.968419661 E 95 no accuracy improvement
37E, 38E : 7.968419664 E 95 with the improvement
Checked on both multicalc and nonpareil, a confirmation on the real machines is welcome.
Both results confirmed on a real machine
Andi
Find all posts by this user
Quote this message in a reply
Post Reply 




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