HP Forums

Full Version: Online calculator simulators?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(07-09-2022 09:17 PM)Albert Chan Wrote: [ -> ]This has less to do with calculators, and more to do with math.

sin(9°) = sin(pi/20) ≈ pi/20
cos(sin(9°)°) ≈ cos(pi/20 * pi/180) ≈ 1 - (pi^2/3600)^2 / 2! ≈ 0.999996

We had lost 5+ digits precision, due to catastrophic cancellation.
That's why all calculator forensic test will lose 5 to 6 digits precisions.
This is true even if all calculations produce correctly rounded results!
[...]

This is a great observation. I have always found this test a little bit arbitrary and dubious, for the exact same reasons.

(It is a good test though to differentiate emulators from simulators.)

1 sin cos tan arctan arccos arcsin

in radians would have been a much better test.
(07-10-2022 03:28 AM)pauln Wrote: [ -> ]
(07-09-2022 09:17 PM)Albert Chan Wrote: [ -> ]This has less to do with calculators, and more to do with math.

sin(9°) = sin(pi/20) ≈ pi/20
cos(sin(9°)°) ≈ cos(pi/20 * pi/180) ≈ 1 - (pi^2/3600)^2 / 2! ≈ 0.999996

We had lost 5+ digits precision, due to catastrophic cancellation.
That's why all calculator forensic test will lose 5 to 6 digits precisions.
This is true even if all calculations produce correctly rounded results!
[...]

This is a great observation. I have always found this test a little bit arbitrary and dubious, for the exact same reasons.

(It is a good test though to differentiate emulators from simulators.)

1 sin cos tan arctan arccos arcsin

in radians would have been a much better test.

My own take was that it has less to do with emulators vs simulators, but it does expose the under the hood math. Modern Casio's perform all calculations under the hood to 15 significant digits and they lose 6 digits of precision in this test. I was under the impression that HP's 50g and Prime also perform most calculations to 15 digits but this doesn't seem to be the case with trigonometric functions.

With Mathematica, I specified 14 significant digits via the NumberForm command and it also lost 6 digits of precision due to rounding error.

Albert's observation was indeed very good.

BTW if the test is performed with radians, all decent calculators resolve to 1 without any roundoff error. Looking forward to Alberts insight ref why roundoff error doesn't occur in with radians.
A friend of mine sent me this around 2020:

[Image: 9AO6jf]

And shamefully, I hadn't as yet read it, but I did start reading it this morning as this discussion reminded me that I already have the title in my ebook library. It's the second edition published in 2018, so it's a contemporary exposition on the subject.

Handbook of Floating-Point Arithmetic.
(07-10-2022 06:18 AM)jonmoore Wrote: [ -> ]
(07-10-2022 03:28 AM)pauln Wrote: [ -> ]This is a great observation. I have always found this test a little bit arbitrary and dubious, for the exact same reasons.

(It is a good test though to differentiate emulators from simulators.)

1 sin cos tan arctan arccos arcsin

in radians would have been a much better test.
[...] BTW if the test is performed with radians, all decent calculators resolve to 1 without any roundoff error. [...]

That's funny! To say the truth I had only checked on the TI-57 and TI-59. From that point of view they are not decent calculators : ) (they don't resolve to 1 exactly). But I see other calculators resolve to exactly 1.

Definitely not a great test. (Maybe 1.111..1 sin cos tan arctan arccos arcsin in radians?)

Actually the original test (9 sin cos tan arctan arccos arcsin in degrees) is great to verify that 2 different calculators use the exact same algorithm (but not necessarily to test the quality of these algorithms).
(07-10-2022 03:28 AM)pauln Wrote: [ -> ]
(07-09-2022 09:17 PM)Albert Chan Wrote: [ -> ]This has less to do with calculators, and more to do with math.

sin(9°) = sin(pi/20) ≈ pi/20
cos(sin(9°)°) ≈ cos(pi/20 * pi/180) ≈ 1 - (pi^2/3600)^2 / 2! ≈ 0.999996

We had lost 5+ digits precision, due to catastrophic cancellation.
That's why all calculator forensic test will lose 5 to 6 digits precisions.
This is true even if all calculations produce correctly rounded results!
[...]

This is a great observation. I have always found this test a little bit arbitrary and dubious, for the exact same reasons.

(It is a good test though to differentiate emulators from simulators.)

1 sin cos tan arctan arccos arcsin

in radians would have been a much better test.

The purpose of the original test was not to see how close a calculator could come to 9 but it
Quote:...seeks to answer the questions of who originally designed a particular calculator's chip set, what features of a particular calculator have been borrowed from earlier designs, and how has calculator technology spread among the manufacturers.

To use it for other purposes isn't the intent of the author.

Calculator Forensics
(07-10-2022 04:48 PM)pauln Wrote: [ -> ]That's funny! To say the truth I had only checked on the TI-57 and TI-59. From that point of view they are not decent calculators : ) (they don't resolve to 1 exactly). But I see other calculators resolve to exactly 1.

Not being tribal here, as you can probably tell from previous posts of mine in this thread, I have little to no time for tribalism.

I think it's fair to say if there's one time when Dr Kahan's knowledge gave HP the edge, was from the mid seventies till the mid eighties.

I'll rephrase my original comment to any decent calculator released in the last 20 years or so should resolve to 1. Certainly any I tested from that timeframe resolved to 1 (TI, Casio and HP, in fact most went back far more than 20 years but I thought I'd err on the side of caution). Smile
(07-10-2022 06:04 PM)toml_12953 Wrote: [ -> ]The purpose of the original test was not to see how close a calculator could come to 9 but it
Quote:...seeks to answer the questions of who originally designed a particular calculator's chip set, what features of a particular calculator have been borrowed from earlier designs, and how has calculator technology spread among the manufacturers.

To use it for other purposes isn't the intent of the author.

Calculator Forensics

That makes far more sense as a 'forensic test'.
(07-10-2022 06:08 PM)jonmoore Wrote: [ -> ]
(07-10-2022 04:48 PM)pauln Wrote: [ -> ]That's funny! To say the truth I had only checked on the TI-57 and TI-59. From that point of view they are not decent calculators : ) (they don't resolve to 1 exactly). But I see other calculators resolve to exactly 1.

Not being tribal here, as you can probably tell from previous posts of mine in this thread, I have little to no time for tribalism.

I think it's fair to say if there's one time when Dr Kahan's knowledge gave HP the edge, was from the mid seventies till the mid eighties.

I'll rephrase my original comment to any decent calculator released in the last 20 years or so should resolve to 1. Certainly any I tested from that timeframe resolved to 1 (TI, Casio and HP, in fact most went back far more than 20 years but I thought I'd err on the side of caution). Smile

I completely agree. Actually I own the HP-67/97/41/15c from that era.

Interestingly, Free 42 / 42S, and presumably DM42, do not resolve to 1 (They resolve to 1 + 1E-33).
(07-10-2022 06:46 PM)pauln Wrote: [ -> ]Interestingly, Free 42 / 42S, and presumably DM42, do not resolve to 1 (They resolve to 1 + 1E-33).
Try Free24Binary/Plus42Binary desktop version Wink
(07-10-2022 07:33 PM)Ajaja Wrote: [ -> ]
(07-10-2022 06:46 PM)pauln Wrote: [ -> ]Interestingly, Free 42 / 42S, and presumably DM42, do not resolve to 1 (They resolve to 1 + 1E-33).
Try Free24Binary/Plus42Binary desktop version Wink

Nice! It resolves to exactly 1 on the binary version. Surprisingly, "3 1/x 3 x" resolves to 1 exactly on the binary version (but not on the decimal version).

But according to their website, the DM42 uses the decimal version: https://www.swissmicros.com/product/dm42

So that would be an example of an excellent (by what I read) modern calculator that doesn't resolve to 1. By the way, that's not a defect at all. Smile
Pages: 1 2
Reference URL's