Just a curious mathematical result
03-05-2018, 10:54 PM
Post: #1
 Valentin Albillo Senior Member Posts: 408 Joined: Feb 2015
Just a curious mathematical result
Hi all,

Just to let you know about a curious mathematical result I discovered recently. In radians:

Sin(9*(Sin(1) + Cos(40))) =    0.999999999999999830826985368...

which differs from the integer 1 by about 1e16. If you compute it on a 12-digit machine (such as the HP-71B) y will probable get evaluated as exactly 1. The correct value requires more than 12 digits, in a pinch the Windows calculator will do.

¿ Nice, isn't it ?

V.
.

Find All My HP-related Materials here:  Valentin Albillo's HP Collection

03-05-2018, 11:33 PM
Post: #2
 Carsen Member Posts: 180 Joined: Jan 2017
RE: Just a curious mathematical result
This little problem makes me appreciate Longfloat and newRPL very much.
03-05-2018, 11:33 PM (This post was last modified: 03-06-2018 12:12 AM by Valentin Albillo.)
Post: #3
 Valentin Albillo Senior Member Posts: 408 Joined: Feb 2015
RE: Just a curious mathematical result
(03-05-2018 11:08 PM)Mike (Stgt) Wrote:  Should be added here.
Ciao.....Mike

(sorry for the typos there in my original post, virtual keyboards can be a chore and I didn't have time to properly proofread)

Yes, I think you're right so I've just contacted the people in charge of the web page you mentioned to let them know and perhaps consider including it there.

By the way, Mike, did you have a look at the PDF document I suggested in my reply to your post on Namir's thread, namely:

AMS - Computing square root of 2 to 1,000,000 digits

The document discusses algorithms used in the past to compute square roots to thousands of digits and in particular the one used to reach 1,000,000 digits.

Also, to check your very own implementation simply google "square root of 2 to 1 million digits" and you'll immediately find a link to the full result.

Regards.
V.
.

Find All My HP-related Materials here:  Valentin Albillo's HP Collection

03-06-2018, 07:07 AM
Post: #4
 pier4r Senior Member Posts: 2,016 Joined: Nov 2014
RE: Just a curious mathematical result
A question would be. How did you get that formula in the first place? It is not a common one.

Wikis are great, Contribute :)
03-06-2018, 01:59 PM
Post: #5
 DA74254 Member Posts: 125 Joined: Sep 2017
RE: Just a curious mathematical result
Works on SM DM42 but gives "1" in Prime "home" rpn and "1." in Prime CAS

Esben
28s, 35s, 49G+, 50G, Prime G1 HW A, Prime G2 HW D, SwissMicros DM42
Elektronika MK-52 & MK-61
03-06-2018, 02:10 PM
Post: #6
 TheKaneB Member Posts: 173 Joined: Jul 2014
RE: Just a curious mathematical result
(03-06-2018 01:59 PM)DA74254 Wrote:  Works on SM DM42 but gives "1" in Prime "home" rpn and "1." in Prime CAS

Well, it's the correct answer given the HP Prime's number of digits / bits in the two modes.

Software Failure: Guru Meditation

--
Antonio
IU2KIY
03-06-2018, 03:02 PM
Post: #7
 Jake Schwartz Member Posts: 210 Joined: Dec 2013
RE: Just a curious mathematical result
...and the WP-34S in double-precision mode yields
0.9999999999999998308269853686957601

Jake
03-06-2018, 03:05 PM
Post: #8
 DA74254 Member Posts: 125 Joined: Sep 2017
RE: Just a curious mathematical result
(03-06-2018 02:10 PM)TheKaneB Wrote:
(03-06-2018 01:59 PM)DA74254 Wrote:  Works on SM DM42 but gives "1" in Prime "home" rpn and "1." in Prime CAS

Well, it's the correct answer given the HP Prime's number of digits / bits in the two modes.

Yes, I'm aware of that. But if you calculate a large number, say; 99^20, you may hit "view" and you can obtain a number 100's of digits long. Then 1/x and you get a resiprocal of that large number. Though, the "1." in CAS is absolute. You won't be able to evaluate it, only obtain the approx version of the formula stated by OP.

Esben
28s, 35s, 49G+, 50G, Prime G1 HW A, Prime G2 HW D, SwissMicros DM42
Elektronika MK-52 & MK-61
03-06-2018, 04:15 PM (This post was last modified: 03-06-2018 04:32 PM by jebem.)
Post: #9
 jebem Senior Member Posts: 1,311 Joined: Feb 2014
RE: Just a curious mathematical result
(03-06-2018 01:59 PM)DA74254 Wrote:  Works on SM DM42 but gives "1" in Prime "home" rpn and "1." in Prime CAS

Yes, HP Prime on CAS mode gives me 1. for approx(SIN(9*(SIN(1)+COS(40))))
However doing 1-Ans gives me 3.5527136788 E-15

So, not exactly the same answer of absolute 1 as got on Home mode, where 1-Ans gives exactly 0.

Further quick searching on google shows a few answers for the above CAS result of 3.5527136788 E-15 for instance here.
Apparently this value corresponds to 8 ^ -16 or 16 ^ -12 or -64 ^ -8 (i didn't take the time to check it).

Tim and Cyrille have been posting some information on the numbers internal representation being different on Home and on CAS modes, and that can explain the different results when trying to get the hidden guard digits on each mode.

Jose Mesquita

03-06-2018, 04:35 PM
Post: #10
 BartDB Member Posts: 159 Joined: Feb 2015
RE: Just a curious mathematical result
(03-06-2018 03:05 PM)DA74254 Wrote:
(03-06-2018 02:10 PM)TheKaneB Wrote:  Well, it's the correct answer given the HP Prime's number of digits / bits in the two modes.

Yes, I'm aware of that. But if you calculate a large number, say; 99^20, you may hit "view" and you can obtain a number 100's of digits long. Then 1/x and you get a resiprocal of that large number. Though, the "1." in CAS is absolute. You won't be able to evaluate it, only obtain the approx version of the formula stated by OP.

Hi,

The Prime can do large integers, but for floating point numbers will always be 12 digit accuracy (actually CAS is double precision floating point, which could be 15 digits - but i'm not sure the developers will guarantee this).
.

03-06-2018, 04:44 PM (This post was last modified: 03-06-2018 04:51 PM by BartDB.)
Post: #11
 BartDB Member Posts: 159 Joined: Feb 2015
RE: Just a curious mathematical result
(03-06-2018 04:15 PM)jebem Wrote:
(03-06-2018 01:59 PM)DA74254 Wrote:  Works on SM DM42 but gives "1" in Prime "home" rpn and "1." in Prime CAS

Yes, HP Prime on CAS mode gives me 1. for approx(SIN(9*(SIN(1)+COS(40))))
However doing 1-Ans gives me 3.5527136788 E-15

So, not exactly the same answer of absolute 1 as got on Home mode, where 1-Ans gives exactly 0.

Further quick searching on google shows a few answers for the above CAS result of 3.5527136788 E-15 for instance here.
Apparently this value corresponds to 8 ^ -16 or 16 ^ -12 or -64 ^ -8 (i didn't take the time to check it).

Tim and Cyrille have been posting some information on the numbers internal representation being different on Home and on CAS modes, and that can explain the different results when trying to get the hidden guard digits on each mode.

1 - sin(9*sin(1)+cos(40))) should yield 1.69173...E-16, so the Prime is quite wrong.

CAS approx. is double precision floating point which gives 15 digit accuracy (17 at most, but for Prime CAS I have found it to be seldom better than 15). However, as you have demonstrated, more digits can be found by subtracting the more significant digits - but I have found they are usually wrong. So I would not rely on it.
.

03-06-2018, 04:49 PM (This post was last modified: 03-06-2018 04:54 PM by BartDB.)
Post: #12
 BartDB Member Posts: 159 Joined: Feb 2015
RE: Just a curious mathematical result
(03-05-2018 11:08 PM)Mike (Stgt) Wrote:
(03-05-2018 10:54 PM)Valentin Albillo Wrote:  Hi all,

Just to let you know about a curious mathematical result I discovered recently. In radians:

Sin(9*(Sin(1) + Cos(40))) = 0.999999999999999830826985368...

which differs from the integer 1 by about 1e16. If you compute it on a 12-digit machine (such as the HP-71B) y will probable get evaluated as exactly 1. The correct value requires more than 12 digits, in a pinch the Windows calculator will do.

¿ Nice, isn't it ?

V.
.

Ciao.....Mike

These type of equations should be called "Rube Goldberg methods of obtaining almost integers"
.

03-06-2018, 05:53 PM
Post: #13
 KeithB Member Posts: 191 Joined: Jan 2017
RE: Just a curious mathematical result
Or weird approximations of pi.
18*(sin(1) + cos(40)) ~= pi
03-07-2018, 11:42 AM
Post: #14
 EdS2 Member Posts: 133 Joined: Apr 2014
RE: Just a curious mathematical result
(03-06-2018 05:53 PM)KeithB Wrote:  Or weird approximations of pi.
18*(sin(1) + cos(40)) ~= pi

That's a good unpacking. The original outer use of sin() is mapping something close to pi/2 to something much closer to 1. It looks impressive - I was impressed - but it's a trick.
03-07-2018, 02:23 PM
Post: #15
 Thomas Okken Senior Member Posts: 865 Joined: Feb 2014
RE: Just a curious mathematical result
(03-07-2018 11:42 AM)EdS2 Wrote:  The original outer use of sin() is mapping something close to pi/2 to something much closer to 1.

Yep. In the same vein, sin(11/7) = 0.9999998...
 « Next Oldest | Next Newest »

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