Post Reply 
sin(x)^2+cos(x)^2 = 1 on different calcs
09-25-2018, 04:10 PM (This post was last modified: 09-26-2018 07:03 AM by J-F Garnier.)
Post: #10
RE: sin(x)^2+cos(x)^2 = 1 on different calcs
(09-25-2018 02:35 PM)Albert Chan Wrote:  I am not sure about the proof though. IIRC, 30S use binary mathematics:

1/3 = 0.010101011 (binary, say 8 bits mantissa)
2/3 = 0.10101011
3/3 = 1.000000001 -> half-way round-to-even = 1.0

1/3 = 0.01010101 (binary, say 7 bits mantissa)
2/3 = 0.1010101
3/3 = 0.11111111 -> half-way round-to-even = 1.0

So, whatever bits 30S uses (odd or even), 1/3*3 = 1, no cheating (in this case)

Yes, the 1/3*3-1 test doesn't work on binary machines.
In this case, I'm using the test 1/3+1-1-1/3 to estimate the mantissa resolution (number of bits).

BTW, The MS excel is using the "small differences set to zero feature" , but you can defeat it easily by using parentheses:
e.g. =1/3+1-1-1/3 -> 0
but =(1/3+1-1-1/3) -> -5.55112E-17 (2^-54)

J-F
[edited: corrected 2^-54]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: sin(x)^2+cos(x)^2 = 1 on different calcs - J-F Garnier - 09-25-2018 04:10 PM



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