Post Reply 
Accuracy Management of early HPs
09-09-2022, 11:36 PM (This post was last modified: 09-09-2022 11:38 PM by Matt Agajanian.)
Post: #1
Accuracy Management of early HPs
Hi all.

Earlier, I read the the Nov. '76 Jornal article 'The New Accuracy: Making 2^3=8.' So, with calculators returning 10 digit results within the limits of algorithm accuracy and a finite digit count, how were calculators viable and relevant for use in the sciences, especially places such JPL, MIT, CalTech, hardware such as space/oceanographic equipment and missions?
Find all posts by this user
Quote this message in a reply
09-10-2022, 02:09 AM
Post: #2
RE: Accuracy Management of early HPs
i would imagine that anything that required accuracy greater than 10 digits would be used with either a computer, or one of the larger desktop calculators, depending on exactly how many digits of accuracy were needed. Most of the users that needed greater than 10 digit accuracy knew about the accuracy limitations of the early HPs and took those into account when working on things. Just speculation on my part, but seems straightforward and logical to me.
Find all posts by this user
Quote this message in a reply
09-10-2022, 04:49 AM (This post was last modified: 09-10-2022 04:50 AM by Steve Simpkin.)
Post: #3
RE: Accuracy Management of early HPs
Dr William Kahan was directly responsible for this increased accuracy, starting with the HP-27. See page 144 of the following oral history.
http://history.siam.org/pdfs2/Kahan_final.pdf

"Hewlett-Packard had come out with a beautifully engineered job called the HP-35, which was the first scientific
calculator with all the scientific functions instead of just the add, subtract, multiply, divide, and
maybe a square root. And then they came out with the HP-45, which was an improved version. It
had more functionality.
But in the meantime, Texas Instruments came out with a calculator that was a great deal cheaper,
and here’s how they advertised their calculator. So TI had this advertisement in the papers. It was
a full-page advertisement. It said, “Type in your telephone number. Now,” they said, “Take the
logarithm.” The logarithm turns out to be a number form ten-point-something, or nine-pointsomething,
actually. “Now hit the exponential key. Do you get your phone number back? You do
on our calculator.” HP knew that it was the target of this advertisement because it did that on an
HP-45, which carried ten digits. You type in your ten-digit phone number, take the log, take the
exponential, and the last digit or two would change but, apparently, not on the TI calculator. HP
was very worried about this, because it seemed to impugn the integrity of their beast.

It was a very neat job, the HP-35, for all its faults—and it had lots. It was really a very nice
job, and then, of course, it went to the HP-45, which was just sort of an expanded, extended version of the HP-35. And the other
guys were getting into the act. What one fool can do, another can, so TI had gotten into the act
using relatively similar algorithms.And HP was now embarrassed because it appeared that their calculator
was somehow defective, and they were worried about it—I mean, really worried about it. They thought they
had a certain reputation, and it was being undermined by this calculator. So fortunately, I asked what the
problem was all about, and I said, “Can you send me samples of the calculators for me to play
with before I come to the meeting?” And they did. So I had an HP-45, and I had an SR51.
And I discovered what was happening. It’s true that the HP-45’s arithmetic was somewhat grotty
in spots, but it wasn’t that bad. But what TI was doing was clever. You see, the 45 did its
arithmetic to ten significant decimals, period. Everything was done to ten significant decimals,
including the internal algorithms that computer logs and exponentials. TI was doing their
arithmetic internally carrying 13 significant decimals, but they only showed you ten. So that
meant that, though you type ten digits in, as soon as you did some arithmetic, you had 13
decimal digits. But you only saw ten significant decimals. Well, that could hide a lot of sins,
couldn’t it? The TI thing was cheaper, but that’s because Hewlett-Packard can’t do anything
that’s cheap there. Their whole culture is such that, whatever they do, it’s going to be expensive.
So I discovered that if you did this log exponential thing seven times, then the last digit would
change. You see, their arithmetic at the 13th digit was grottier, if anything could be grottier, than
the 45. And because it was worse arithmetic intrinsically, it meant that it didn’t take very long
for the error to creep up through those three digits. Seven times was enough. So I then was able
to turn up and say, “Look: everybody who looks at that ad is being fooled. They think that the TI
machine is reproducing your telephone number, but it isn’t. It’s your telephone number with a
last digit diminished by one, followed by a certain number of nines, like two nines and a digit.
Then it gets rounded up, you see, so it shows up properly in the display. They round in the
display, even though they don’t round the arithmetic.” I said, “You do this seven times, and then
you’re going to get something with your digit, less one, and followed by a four-something
something because the arithmetic is so crummy. After you’ve done it seven times, your
telephone number changes. Do you feel that that’s honest? Is this an honest ad?”
Well, certainly it’s got to be mysterious. Somebody who doesn’t realize what’s going on has to
find it mysterious that after he does this seven times, that digit changes. That was a shock, and
now they realized that they were in a world that was not the world they thought they were in.
Whatever the hell was going on, they really weren’t in control of it, but I also came with a
proposal to cure the problem. I said, “You can do what they do, except for one thing: in order to
be honest, round every result back to ten digits even if you carry thirteen to compute it.” And I
said, “If you do that, then each operation, taken by itself, will give you a rather honest answer,
and you can explain this log exponential thing. That’s easy because when you take the log,
you’ve got the right log. It’s correct to within just a little bit worse than half a unit in the last
digit of the display. Then you can say ‘Now, it’s that error that propagates when you take the
exponential because, if we recovered your telephone number, we’d be getting the exponential not
of the number that you see before you. It would have to be the exponential of something else.’’’
"HAIGH: So was the calculator using decimal arithmetic?
KAHAN: Oh, absolutely, yes. It was using BCD arithmetic. Well, the guys who were there
weren’t certain that they could see how to do this, but one of the people there, Dennis Harms
actually had a math Ph.D. from, I believe it was, the University of Iowa. Dennis had a very
respectable enough PhD from a respectable enough place, but it was in a topic altogether
different from what he was now doing at Hewlett-Packard because he was essentially amicroprogrammer.
I’ve got to tell you, it could’ve been hard to get a job with a math Ph.D. at
that time. And he understood, I think, instantly what I was saying. I don’t know exactly how long
it took him, but he went back. He rewrote the microcode in a few places, and the next thing you
know they were doing what I said they should do.
The first calculator that was doing what I said they should do was the HP-27, and they sent me a prototype
that I could play with to see whether things were working out the way I said.
Things were working out the way I said they would. The functions really did look a lot better. In fact,
Dennis Harms actually wrote a little paper, I think, that got published in The HP Journal somewhere."
Visit this user's website Find all posts by this user
Quote this message in a reply
09-10-2022, 07:48 AM
Post: #4
RE: Accuracy Management of early HPs
Remember that the usual slide rules are only accurate to 3 digits or perhaps a very little more. Handheld calculators were heaps better - so much so, that people often need to be taught not to give results with meaningless extra precision.

"The new accuracy" is certainly an improvement in the product, but as Steve notes it comes from the market: TI would compare accuracy and HP wouldn't look good. Even if the comparison is superficial, it has an effect on sales.

i think 10 digits - even before the new accuracy - is enough for a great deal of science and engineering.

If the initial offering had been 6, or 12, and had then been improved, would we have exactly the same question as to how people managed previously?
Find all posts by this user
Quote this message in a reply
09-10-2022, 08:44 AM
Post: #5
RE: Accuracy Management of early HPs
(09-10-2022 07:48 AM)EdS2 Wrote:  Remember that the usual slide rules are only accurate to 3 digits or perhaps a very little more. Handheld calculators were heaps better - so much so, that people often need to be taught not to give results with meaningless extra precision.

Has everyone heard the story of the museum tour guide who told the group, "This dinosaur skeleton is 65 million and 15 years old." One woman asked him how he knew that so precisely. He said, "It's simple. When I started working here 15 years ago, they told me this skeleton was 65 million years old!"

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
09-10-2022, 07:22 PM (This post was last modified: 09-10-2022 07:24 PM by Matt Agajanian.)
Post: #6
RE: Accuracy Management of early HPs
SNIP
(09-10-2022 04:49 AM)Steve Simpkin Wrote:  Dr William Kahan was directly responsible for this increased accuracy, starting with the HP-27. See page 144 of the following oral history.
http://history.siam.org/pdfs2/Kahan_final.pdf

I said, “You can do what they do, except for one thing: in order to
be honest, round every result back to ten digits even if you carry thirteen to compute it.” And I
said, “If you do that, then each operation, taken by itself, will give you a rather honest answer,
and you can explain this log exponential thing. That’s easy because when you take the log,
you’ve got the right log. It’s correct to within just a little bit worse than half a unit in the last
digit of the display. Then you can say ‘Now, it’s that error that propagates when you take the
exponential because, if we recovered your telephone number, we’d be getting the exponential not
of the number that you see before you. It would have to be the exponential of something else.’’’
SNIP

Clarify some things, please.

1--Am I to understand that to preserve and display accurate results

(Step 1) a calculation is carried out to 13 places.

(Step 2) this calculated result is displayed and rounded to 10 digits (although 13 digits are internally maintained)

(Step 3) the next calculation uses the 10 digit displayed figure, but calculated with the internal 13 digit result.

(Step 4) Go back to Step 2.

Or am I missing something?
Find all posts by this user
Quote this message in a reply
09-10-2022, 08:11 PM
Post: #7
RE: Accuracy Management of early HPs
(09-10-2022 07:22 PM)Matt Agajanian Wrote:  SNIP
(09-10-2022 04:49 AM)Steve Simpkin Wrote:  Dr William Kahan was directly responsible for this increased accuracy, starting with the HP-27. See page 144 of the following oral history.
http://history.siam.org/pdfs2/Kahan_final.pdf

I said, “You can do what they do, except for one thing: in order to
be honest, round every result back to ten digits even if you carry thirteen to compute it.” And I
said, “If you do that, then each operation, taken by itself, will give you a rather honest answer,
and you can explain this log exponential thing. That’s easy because when you take the log,
you’ve got the right log. It’s correct to within just a little bit worse than half a unit in the last
digit of the display. Then you can say ‘Now, it’s that error that propagates when you take the
exponential because, if we recovered your telephone number, we’d be getting the exponential not
of the number that you see before you. It would have to be the exponential of something else.’’’
SNIP

Clarify some things, please.

1--Am I to understand that to preserve and display accurate results

(Step 1) a calculation is carried out to 13 places.

(Step 2) this calculated result is displayed and rounded to 10 digits (although 13 digits are internally maintained)

(Step 3) the next calculation uses the 10 digit displayed figure, but calculated with the internal 13 digit result.

(Step 4) Go back to Step 2.

Or am I missing something?

I may not have a complete understanding of what is going on internally but I believe the sequence is more like the following:

(Step 1) An "intermediate" calculation is carried out to 13 places. I believe this can be done even though the HP hardware only allows the storage of 10-digit numbers since the algorithms are working on a 4-bit BCD digit at a time.

(Step 2) This calculated result is rounded to 10 digits and is stored as a 10-digit number. This number is also displayed as a 10-digit number. Keep in mind the the HP hardware has 56-bit data registers that can only store 10-digit BCD numbers (10 digit mantissa, a 2 digit exponent and signs for the mantissa and exponent).

(Step 3) The next calculation uses the 10 digit stored numbers, since that is all that is available with 56-bit registers.

(Step 4) Go back to Step 1.

I Believe the TI calculators used more than 56-bits in their data registers so they could actually store the 13 (or higher) digit results of calculations, even if they only displayed 10 (or less) rounded digits of that register.
Visit this user's website Find all posts by this user
Quote this message in a reply
09-10-2022, 08:18 PM
Post: #8
RE: Accuracy Management of early HPs
Hello!

(09-10-2022 08:11 PM)Steve Simpkin Wrote:  I Believe the TI calculators used more than 56-bits in their data registers so they could actually store the 13 (or higher) digit results of calculations, even if they only displayed 10 (or less) rounded digits of that register.

See here: https://www.hpmuseum.org/cgi-sys/cgiwrap...read=87389

Not that it really matters. Very few calculations require this kind of precision. And those who do are not done on pocket calculators.

Regards
Max
Find all posts by this user
Quote this message in a reply
09-11-2022, 08:06 AM
Post: #9
RE: Accuracy Management of early HPs
Thanks for the link back, there's a good description in there.

At least the early HPs tend to display to some fixed number of decimal places - that's a good practice for science and engineering, and almost always means that the displayed result will have fewer digits than the calculated result.

But at the time of purchase or demonstration, or in schoolyard competition, being able to take the square root of 2 and square it, and apparently get back the number you started with, has a clear attraction.

Quote:The argument raged for quite some time, IIRC, about the advantages of 10 good rounded digits vs. 13 digits displayed as 10.
Find all posts by this user
Quote this message in a reply
09-11-2022, 08:44 PM (This post was last modified: 09-11-2022 08:46 PM by Matt Agajanian.)
Post: #10
RE: Accuracy Management of early HPs
Hi all.

Lets me just say.

I feel this thread I started does have some relevance. For example, the 12C has been a mandatory part of a financier, banker, and accountant’s equipment.

In their world, they’ll probably encounter figures in the millions or in the extreme, billions. So, I would think accuracy their first concern. I could only guess if figures in the trillions cross a financial pro's situations. Well then, accuracy must be their primary point of interest (pun intended). At least results or variables should be of the utmost accuracy.

So, whatever range of monies any financial pro requires, I
would presume they would put top importance on the accuracy in calculations from the 12C or other calculators.
Find all posts by this user
Quote this message in a reply
09-12-2022, 12:07 AM
Post: #11
RE: Accuracy Management of early HPs
(09-11-2022 08:44 PM)Matt Agajanian Wrote:  Hi all.
Lets me just say.
I feel this thread I started does have some relevance. For example, the 12C has been a mandatory part of a financier, banker, and accountant’s equipment.
In their world, they’ll probably encounter figures in the millions or in the extreme, billions. So, I would think accuracy their first concern. I could only guess if figures in the trillions cross a financial pro's situations. Well then, accuracy must be their primary point of interest (pun intended). At least results or variables should be of the utmost accuracy.
So, whatever range of monies any financial pro requires, I
would presume they would put top importance on the accuracy in calculations from the 12C or other calculators.

That dovetails nicely into the second half of the improved accuracy algorithms for scientific calculations that Dr Kahan developed for HP and that were first used in the HP-27. As it turns out, he discovered problems with the financial calculations used in the HP-27 (and earlier financial models) that led to the internal recall of the HP-27 before the first one was even sold.

KAHAN:
"The first calculator that was doing what I said they should do was the HP-27, and they sent me a
prototype that I could play with to see whether things were working out the way I said. Things
were working out the way I said they would. The functions really did look a lot better. In fact,
Dennis Harms actually wrote a little paper, I think, that got published in The HP Journal
somewhere. But I was puzzled because on the top row of the calculator’s keyboard, they had
these five keys: n, i, pv, pmt, and fe. I said, “And what do they do?” “Oh,” they said, “you don’t
have to know that.” It was on a need-to-know basis, you see. So I looked at these things, and I
finally figured out what they were doing. These for calculating the relationship among the
interest rate, the initial loan value, a regular payment, like payment on a mortgage—the balloon
payment, and the number of payments all totaled. That’s what it was supposed to do. It didn’t
take me long to figure that out. I mean, after all, I had attended an actuarial science course in
which such things were discussed, even if I had read in the back of the class. Then I said, “You
know, if they’re going to compute the interest rate, that’s a non-trivial computation. I wonder if
they can get it right.” And, of course, they couldn’t. So there were cases where I could see that,
although it’s a ten-figure calculator, they’ve only got six figures correct of the interest rate. It
didn’t take me long to find that.
And I phoned my contact at Hewlett-Packard. I said, “Listen, I figured out what you’re doing
here, but I’ve got to tell you, you’re losing digits. I’ve got this very simple example. It took me
only a few moments to construct, and your interest rate is good to only six figures.” And the guy
said, “Well, that’s okay; all we need is six figures.” I said, “Look, you’re going to lose more.” I
found an example, and I called him up, and I said, “Look, here’s an example where you’ve lost
all but four of your figures, and if you want to give me longer, I’ll find some where you lose
them all.” But the fact that he had only four figures correct, that started to worry him. And I
could hear the tone of his voice change—there were pauses. Then I said, “But you know, there is
a way to do this that’ll get it right. And furthermore, it will liberate you from one of the
constraints that you’ve put on the input data I see. That’s an unnecessary constraint.” And I
described the algorithm to him, and then I sent him something.
Yes, he microcoded it up, and he found the calculator worked faster for these interest rate
calculations. The answer was just fine, right out to the last digit. And it didn’t have this
unnecessary restriction, and everything about this was just marvelous except for one thing: they
already had a warehouse full of these calculators in cartons with their manuals, ready to hit the
Christmas market. What should they do? I was invited to a meeting, and David Packard was at
the head of the table of this meeting. I didn’t have much to say. I didn’t have to because my
views were being represented by one of these guys who said, “Our consultant found a bug. The
bug appears to be serious. We found a way to repair the bug; the consultant provided that. All we
have to do is replace ROMs. Unfortunately, that means we have to unsolder the old ROMs and
solder new ROMs in. You can’t just do a plug-in, but we’ve got tools for doing that. What are we
going to do with the thousands of boxes? Should we put them out on the market and insert a little
slip into each one saying, ‘Sorry, there’s a little glitch, and if you send your calculator back,
we’ll fix it’?”And David Packard said, “No, we’re not going to sell a defective product. It’s one thing to put
them out on the market when we didn’t know there was a defect, and then later we have to chase
down people. It’s something else to sell something when we know it’s defective.” And he said,
“We will withdraw the calculators from the warehouse. We’ll make the necessary fix, change the
ROMs, and so on. So we won’t make the Christmas market. We’ll have to go for the Easter
market,” so to speak, or some other subsequent market. That shot my respect for David Packard
up several notches. Now I knew he was a good guy. I knew he was technically competent. I
knew that he ran a company based on what I would have to call humane principles. It wasn’t just
good business. It was broadly humane. But he didn’t delay in that decision. It wasn’t as if it was
an agonizing decision. It was clearly the proper decision. He made it there in my hearing, and I
have to tell this story because there aren’t very many people who know it. And if you wonder
why David Packard had earned the respect of so many of the people who knew him, this is
another one of those stories. But in the meantime, I was in. From now on, I was participating in
these calculators. That was all being done down in Cupertino. The next big task was going to be
the HP-92."


The improved financial calculation algorithms that Dr. Kahan developed for the HP-27 and HP-92 were carried on into the HP-12C and are still in use today, many decades later. They are one of the reasons the HP-12C is considered a de facto standard when it comes to TVM calculations.

Here is an alternate link to the interview with Dr Kahan:
Interview with Dr. William Kahan - August 2005
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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