DM42 and accuracy

 Posts: 2
 Joined: Thu May 21, 2020 11:02 pm
DM42 and accuracy
Hi,
I was playing with the calculator in parallel with python to test and enjoy its accuracy.
Computing 154^154, I get with iPython:
7554244008786559575879374904245441795033866870437465716418717350003149580116668117770406909654319320442010072703598802918492552989100733852103867467407663874552204474375211211930657345710855907754492776113727267222087200137903834965849330652115912127071191115726255782293402295495170668402583178024581141574042154569857487294527130566656
Free42 and DM42 give me:
7,554244008786559575879374904245436e336
The windows calculator with a similar engine:
7,5542440087865595758793749042454e+336
The last two digits given by free42 are wrong. Has anyone encountered similar issues?
Theo
I was playing with the calculator in parallel with python to test and enjoy its accuracy.
Computing 154^154, I get with iPython:
7554244008786559575879374904245441795033866870437465716418717350003149580116668117770406909654319320442010072703598802918492552989100733852103867467407663874552204474375211211930657345710855907754492776113727267222087200137903834965849330652115912127071191115726255782293402295495170668402583178024581141574042154569857487294527130566656
Free42 and DM42 give me:
7,554244008786559575879374904245436e336
The windows calculator with a similar engine:
7,5542440087865595758793749042454e+336
The last two digits given by free42 are wrong. Has anyone encountered similar issues?
Theo
Re: DM42 and accuracy
It looks like iPython is able to give arbitrary precision results.
The DM 42 is not.
Behind the scenes, it calculated e^(154 * ln(154)). It gave you an answer accurate to 32 digits having evaluated two transcendental functions. Most pocket calculators give you between 8 and 12 digits of accuracy.
The DM 42 is not.
Behind the scenes, it calculated e^(154 * ln(154)). It gave you an answer accurate to 32 digits having evaluated two transcendental functions. Most pocket calculators give you between 8 and 12 digits of accuracy.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
Re: DM42 and accuracy
In python you can set the precision to any number of digits (up to 1000 I beleive.)
from mpmath import *
mp.dps=100
mp.prec=100
mpf(154**154)
Gives 100 digits precision and 100 decimal places, and it gives you an error in the last 2 digits comparable with the DM42.
As far as I know the DM42 works internally with 100 digits precision, never actually checked.
In normal life the DM42 is way beyond what I need but playing around is always fun.
The WP43S uses 1000 digits precision in case you need that.
from mpmath import *
mp.dps=100
mp.prec=100
mpf(154**154)
Gives 100 digits precision and 100 decimal places, and it gives you an error in the last 2 digits comparable with the DM42.
As far as I know the DM42 works internally with 100 digits precision, never actually checked.
In normal life the DM42 is way beyond what I need but playing around is always fun.
The WP43S uses 1000 digits precision in case you need that.
HP41C (2x), HP41CV, HP41CX, DM41X β, DM42, HP11C, HP48G, HP97
Re: DM42 and accuracy
Hmmh ... in principle but the DM42 works with Free42 precision, i.e. 39 digits internally and up to 34 digits output. Same applies to the WP34S in double precision mode and to the WP43S in general but the latter uses 72 digits internally for solving quadratic equations, 75 digits for statistics, up to 1001 digits for integers, and even 1065 digits for 2π modulo reduction for trigonometric functions. Just FYI.
DM42 SN: 00041 Beta
WP 43S running on this device
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L
WP 43S running on this device
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L

 Posts: 716
 Joined: Tue May 02, 2017 5:48 pm
 Location: United States
 Contact:
Re: DM42 and accuracy
No, Free42 does not use higher precision internally. It's 34 digits throughout. The result of 154^154 is off by 5 in the final digit because there are no guard digits during the calculation, and the calculation involves multiple calls to the Intel library.
In the case at hand, the calculation behind the scenes is performed as a series of multiplications using repeated squaring; the result from calculating exp(154*ln(154)) would be even worse.
In the case at hand, the calculation behind the scenes is performed as a series of multiplications using repeated squaring; the result from calculating exp(154*ln(154)) would be even worse.
Re: DM42 and accuracy
Thanks, Thomas, for correction of my statement about Free42. I've learned something new today.
DM42 SN: 00041 Beta
WP 43S running on this device
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L
WP 43S running on this device
HP35, HP45, ..., HP50, WP 34S, WP 31S, DM16L
Re: DM42 and accuracy
Of course it is. I did know that but had completely forgotten for some reason! Thanks for the reminder.Thomas Okken wrote: ↑Mon Jun 08, 2020 2:25 pmIn the case at hand, the calculation behind the scenes is performed as a series of multiplications using repeated squaring
There are only 10 kinds of people in the world: those who understand binary and those who do not.

 Posts: 2
 Joined: Thu May 21, 2020 11:02 pm
Re: DM42 and accuracy
Thank you for the quick and detailed replies!
I was well aware that Python can work with arbitrary precision, I was just trying to check the accuracy of the calculator
So in the best of worlds the engine should ideally check the expected error and truncate the last erroneous digits accordingly. But making an error is expected if you have a finite precision and are making a succession of operations.
This makes sense
I was well aware that Python can work with arbitrary precision, I was just trying to check the accuracy of the calculator
So in the best of worlds the engine should ideally check the expected error and truncate the last erroneous digits accordingly. But making an error is expected if you have a finite precision and are making a succession of operations.
This makes sense
Re: DM42 and accuracy
Free42 uses Intel's decimal library. The 34S doesn't. Intel's library is faster, larger and doesn't carry as many guard digits as the 34S.
Pauli
Pauli

 Posts: 19
 Joined: Wed May 03, 2017 5:09 pm
Re: DM42 and accuracy
Does the DM42 (Free42) still use the CORDIC algorithm for exponentiation calculations, as do many hp calculators?
Michel
Michel