Round off error calculation example
07-23-2017, 10:16 AM
Post: #1
 Gamo Senior Member Posts: 702 Joined: Dec 2016
Round off error calculation example
I came across this example from youtube about the round off error on the older computer start from the earlier Pentium CPU which is about the floating point units. Here is the sample: ((2^54)+1)-(2^54) = 0 or 1 ?

I try this on two calculators Casio fx-300ES result is 0 and HP Prime result is 0
and try on the Google Search Calculator result is 0 and on the HP OmniGo 100 result is 0
Only from the WolfarmAlpha website gave result to 1
07-23-2017, 10:29 AM
Post: #2
 Arno K Senior Member Posts: 450 Joined: Mar 2015
RE: Round off error calculation example
For the Prime you should add that you did it in Home-View, the CAS provides the desired 1.
Arno
07-23-2017, 11:57 AM
Post: #3
 Joe Horn Senior Member Posts: 1,793 Joined: Dec 2013
RE: Round off error calculation example
(07-23-2017 10:29 AM)Arno K Wrote:  For the Prime you should add that you did it in Home-View, the CAS provides the desired 1.

Ditto for the HP 49/50g in exact mode, for the same reason.

<0|ɸ|0>
-Joe-
07-23-2017, 12:24 PM (This post was last modified: 07-23-2017 12:34 PM by Csaba Tizedes.)
Post: #4
 Csaba Tizedes Senior Member Posts: 495 Joined: May 2014
RE: Round off error calculation example
(07-23-2017 10:16 AM)Gamo Wrote:  I came across this example...

A good discussion with a great example here: LINK

The example if Hungarian isn't your native: plot (1+1÷(2^n+1))^(2^(n+1)), n=0...50

The result on TI-83+:

The estimation where simplification occurs: 1÷(2^N+1)=5×ALOG(-(B+1)), where N is the function calculated value changed to 1 (where round off error present) and B+1 is the internal digits of calculator. On TI83+: N~44.19 and B+1=14 (on the picture the beginning of the round-off shown, on the upper picture you can see, where and how the value changed to 1).

Csaba
07-23-2017, 05:07 PM (This post was last modified: 07-23-2017 05:13 PM by Dieter.)
Post: #5
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: Round off error calculation example
(07-23-2017 10:16 AM)Gamo Wrote:  I came across this example from youtube about the round off error on the older computer start from the earlier Pentium CPU which is about the floating point units. Here is the sample: ((2^54)+1)-(2^54) = 0 or 1 ?

I try this on two calculators Casio fx-300ES result is 0 and HP Prime result is 0
and try on the Google Search Calculator result is 0 and on the HP OmniGo 100 result is 0
Only from the WolfarmAlpha website gave result to 1

Sure. This is the expected result.

2^54 = 18 014 398 509 481 984. This is a number with 17 digits. The standard IEEE754 floating point format has 15-16 decimal digits. It works with 52 resp. 53 bit precision, that's why the example uses 2^54. Most calculators even work with merely 10 or 12 digits. So in any case 2^54 cannot be represented exactly, and of course adding or subtracting 1 does not make any difference as only the 17th digit is affected.

Example: on an 12-digit machine you get 2^54 = 1,80143985095 · 10^16. Add one and the result still is 1,80143985095 · 10^16. Finally subtract 1,80143985095 · 10^16 and – of course – you get zero.

BTW the Windows calculator works with 30+ digits, so it returns 1 here. ;-)

Dieter
07-23-2017, 06:32 PM (This post was last modified: 07-23-2017 06:38 PM by Mark Hardman.)
Post: #6
 Mark Hardman Senior Member Posts: 525 Joined: Dec 2013
RE: Round off error calculation example
(07-23-2017 05:07 PM)Dieter Wrote:  BTW the Windows calculator works with 30+ digits, so it returns 1 here. ;-)

Dieter

As does the SwissMicros DM42 and Free42 decimal.

Mark Hardman

Ceci n'est pas une signature.
07-23-2017, 07:03 PM
Post: #7
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: Round off error calculation example
(07-23-2017 06:32 PM)Mark Hardman Wrote:
(07-23-2017 05:07 PM)Dieter Wrote:  BTW the Windows calculator works with 30+ digits, so it returns 1 here. ;-)

As does the SwissMicros DM42 and Free42 decimal.

Let's not forget the WP34s (double precision mode), and even the 31s internally uses (at least) 34 digits.

BTW, Free42 has 34 digit BCD precision, but as far as I remember not all functions deliver results with that accuracy. This also is not guaranteed for the WP34s.

Dieter
07-24-2017, 01:17 AM
Post: #8
 Gamo Senior Member Posts: 702 Joined: Dec 2016
RE: Round off error calculation example
Thanks everyone now I got it about the IEEE standard.
 « Next Oldest | Next Newest »

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