Machine accuracy

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: https://technical.swissmicros.com/decoders/dm42/

You can then copy/paste the listing and post it in "code" tags.
Post Reply
hpsoftek65
Posts: 9
Joined: Wed Jun 10, 2020 11:56 pm
Location: Italy

Machine accuracy

Post by hpsoftek65 »

Dear all,

a small algorithm to find out the machine accuracy of the programmable calculator and comparison with DM42, HP50G, HP48G, TI95, TI59

https://technical.swissmicros.com/doc/pdf/eps.pdf

ATTENTION correct PDF file 09/21/2020


Best Regards,

Enrico
Attachments
epsopt.raw
(59 Bytes) Downloaded 39 times
eps.raw
(82 Bytes) Downloaded 38 times
Last edited by hpsoftek65 on Sat Oct 03, 2020 2:39 am, edited 2 times in total.
Joe Horn
Posts: 32
Joined: Thu Oct 04, 2018 2:10 am

Re: Machine accuracy

Post by Joe Horn »

The article says that EPS is "the smallest machine value that can be added to 1.0 that gives a result distinguishable from 1.0". However, the photo of the HP 50g shows an EPS of 7.275957614E-12. But smaller values work too, e.g. 1.0 + 6E-12 --> 1.00000000001

It seems to me that EPS for the HP 50g is 5.00000000001E-12.

Does this article incorrectly assume that the HP 50g and other BCD calculators use IEEE binary floating point?

Disclaimer: If I misunderstood the article, please correct me.
hpsoftek65
Posts: 9
Joined: Wed Jun 10, 2020 11:56 pm
Location: Italy

Re: Machine accuracy

Post by hpsoftek65 »

Dear Joe,

I apologize to everyone and in particular to Joe I was hasty and I did not check, I thought that the calculators HP50G, HP48G, TI95 and TI59 encoded numbers in base 2 instead of base 10, now I have done it and the results are correct. Over the weekend I correct the PDF file and have it updated on the site.

For HP50G 1+10E-12-1 = 10E-12
1+5E-12-1 = 0

Best Regards,

Enrico
TI59.JPG
TI59.JPG (111.22 KiB) Viewed 792 times
HP50G.JPG
HP50G.JPG (124.51 KiB) Viewed 792 times
TI95.JPG
TI95.JPG (121.49 KiB) Viewed 792 times
Joe Horn
Posts: 32
Joined: Thu Oct 04, 2018 2:10 am

Re: Machine accuracy

Post by Joe Horn »

hpsoftek65 wrote:
Fri Sep 18, 2020 9:35 pm
For HP50G 1+10E-12-1 = 10E-12
1+5E-12-1 = 0
If 10E-12 were the EPS for the HP 50g, then 10E-12 would be "the smallest machine value that can be added to 1.0 that gives a result distinguishable from 1.0" (the definition of EPS given in the linked PDF). But it's not the smallest. For example, 9E-12 is smaller than 10E-12, but 1+(9E-12)-1 is not equal to zero. Ditto for 8E-12. And so on, all the way down to 5.00000000001E-12 (the trailing digits are significant!), but nothing smaller, which makes 5.00000000001E-12 the EPS for the HP 50g (as stated in my previous reply).
User avatar
ijabbott
Posts: 198
Joined: Fri Dec 15, 2017 2:34 pm
Location: GB-MAN

Re: Machine accuracy

Post by ijabbott »

Joe Horn wrote:
Sat Sep 19, 2020 6:16 am
hpsoftek65 wrote:
Fri Sep 18, 2020 9:35 pm
For HP50G 1+10E-12-1 = 10E-12
1+5E-12-1 = 0
If 10E-12 were the EPS for the HP 50g, then 10E-12 would be "the smallest machine value that can be added to 1.0 that gives a result distinguishable from 1.0" (the definition of EPS given in the linked PDF). But it's not the smallest. For example, 9E-12 is smaller than 10E-12, but 1+(9E-12)-1 is not equal to zero. Ditto for 8E-12. And so on, all the way down to 5.00000000001E-12 (the trailing digits are significant!), but nothing smaller, which makes 5.00000000001E-12 the EPS for the HP 50g (as stated in my previous reply).
In the wikipedia article it says that outside of academia, machine epsilon is defined as the difference between 1.0 and the next higher floating point number. I think that is actually what hpsoftek65's algorithm is trying to determine, whereas "the smallest machine value that can be added to 1.0 that gives a result distinguishable from 1.0" is more commonly known as the "unit roundoff" assuming round-to-nearest mode.
Post Reply