DM42 and accuracy

Discussion around the Swiss Micros DM42 calculator.
michel.lample
Posts: 19
Joined: Wed May 03, 2017 5:09 pm

Re: DM42 and accuracy

Post by michel.lample » Tue Jun 16, 2020 7:15 pm

SOLVE actually uses two starting values, not one. If you provide only one, the other one will be whatever was left from the last time it ran, which in your case would have been a root, so it would finish immediately.
Thank you for those explanations. I had an old idea that only one guess was used by the algorithm.
So I checked this with the equation 365! / (365^n x (365-n)! )=0 but using the gamma function : Gamma(366)/(365^n Gamma(366-n))

And indeed the solver is now able to converge to n=366 (good theorical result) but without stopping and with a question mark: impossible to calculate... évidemment.

Regards
Michel

Thomas Okken
Posts: 716
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

Re: DM42 and accuracy

Post by Thomas Okken » Tue Jun 16, 2020 9:32 pm

Thomas Okken wrote:
Mon Jun 15, 2020 10:32 pm
To provide only one starting value and ignore any previous values, enter the new starting value twice: 100 [X] 100 [X] [X].
I keep forgetting how the menu decides whether pressing [X] means STO "X" or SOLVE "X". You might think this is done using the number entry flag, but that is not the case. Rather, SOLVE "X" is the action chosen immediately after using the menu to do a STO or SOLVE, and STO "X" is chosen in all other cases.

This means that in order to enter a starting value twice, to force the solver to start with just that starting value and ignore any previous values, you can do something like 100 [X] [ENTER] [X] [X], for example.

JVDB
Posts: 7
Joined: Fri Jun 05, 2020 11:15 pm

Re: DM42 and accuracy

Post by JVDB » Wed Jun 17, 2020 1:43 pm

Might be slightly off-topic but i'm wondering why when calculating in degrees mode sin(180) i get 0. When in rad mode and asking for sin(pi) i have -1.158E-34. Is this because the constant for pi is limited to certain number of digits? The WP43C gives same results, but when in multiples of pi mode asking for sin(1) i have the correct answer : 0.

Thomas Okken
Posts: 716
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

Re: DM42 and accuracy

Post by Thomas Okken » Wed Jun 17, 2020 2:55 pm

JVDB wrote:
Wed Jun 17, 2020 1:43 pm
When in rad mode and asking for sin(pi) i have -1.158E-34. Is this because the constant for pi is limited to certain number of digits?
Yes.

sin(x-pi) = -sin(x), and when x approaches zero, sin(x) = x, so sin(x-pi) = -x. In bid128 (the 34-digit floating-point format used by Free42 Decimal and the DM42), the approximation of pi used is 3.1415926535 8979323846 2643383279 503. A more accurate approximation, to 70 decimals, is 3.1415926535 8979323846 2643383279 5028841971 6939937510 5820974944 5923078164. Subtract that from the bid128 approximation, and what's left is 1.158028306006248941790250554076921836e-34; change the sign of that and round it to 34 digits, and you get the result of PI SIN returned by the calculator, as expected.

User avatar
Walter
Posts: 1570
Joined: Tue May 02, 2017 11:13 am
Location: Close to FRA, Germany

Re: DM42 and accuracy

Post by Walter » Wed Jun 17, 2020 3:33 pm

Radians are the most nasty unit for computing trigonometric functions. Thomas demonstrated this very nicely. This nastiness of Radians was one of the reasons why I introduced 'multiples of pi' for the 43S years ago. Feel free to use these units instead of Radians for getting results meeting your expectations better (although all results are calculated properly with 34 digits).
DM42 SN: 00041 Beta
WP 43S running on this device

HP-35, HP-45, ..., HP-50, WP 34S, WP 31S, DM16L

Post Reply