Live data from Hacker News

Demystifying Floating Point Precision

blog.demofox.org

21–30 of 57 posts

Re: Demystifying Floating Point Precision

#21

I've always thought that floats should be accompanied with a precision value specifying the number of significant digits. Ideally updated by hardware in the same operation. All floating point code has subtle bugs if you don't track error accumulation.

This sounds like unums, a proposed alternative to IEEE floats, where roughly speaking the significand can have variable size thus only boasting as much precision as the accuracy warrants.

Re: Demystifying Floating Point Precision

#22
post #16

Earlier quoted context omitted.

I hate these text-on-picture-with-music videos. Even the robot-voice videos are better. I know it's using the Super Mario music, but still. It's like a blog post where you can't copy or paste anything, can't scroll back and forth, can't be cached or indexed, etc.

He has some videos that are commentated by voice, but for some reason he finds doing the recordings very stressful, so most of his content is unfortunately on his 'uncommentated' channel. I agree it would be nice to have the voice-overs

He could be writing blog posts and making videos to supplement. His writing isn't bad.

Re: Demystifying Floating Point Precision

#23
Speaking of floats, I highly recommend John Gustafson's book, The End of Error: Unum Computing:

https://www.crcpress.com/The-End-of-Error-Unum-Computing/Gus...

It is an amazing compendium of the many ways in which floats fail to give any guarantees in practice. In some cases, due to the format itself, and also because many subtle issues are indicated via internal processor values and flags that are simply not accessible in high-level languages. In addition, the book presents Unums, an alternative number format with several extremely interesting properties that make computations much less error-prone.

Prof. Gustafson has since also presented several additional formats with much stronger guarantees than IEEE floats:

http://www.johngustafson.net/unums.html

Re: Demystifying Floating Point Precision

#25
post #11

Related: A fun video that illustrates floating-point precision by way of Super Mario 64: https://youtu.be/9hdFG2GcNuA

I hate these text-on-picture-with-music videos. Even the robot-voice videos are better. I know it's using the Super Mario music, but still. It's like a blog post where you can't copy or paste anything, can't scroll back and forth, can't be cached or indexed, etc.

Guy did it for free man. Give him a little slack. He's not even a programmer. He does Mario speed runs. He didn't post his video here, someone else did.

And I absolutely disagree with the "Robot voice would be better." That's horrific.

Re: Demystifying Floating Point Precision

#27
post #23

Speaking of floats, I highly recommend John Gustafson's book, The End of Error: Unum Computing : https://www.crcpress.com/The-End-of-Error-Unum-Computing/Gus... It is an amazing compendium of the many ways in which floats fail to give any guarantees in practice. In some cases, due to the format itself, and also because many subtle issues are indicated via internal processor values and flags that are simply not access…

In short, how does u-bit solve multiplication problem when two u-intervals produce >1 interval? Like (1.01+ * 1.01+) = 1.02+ .. 1.04+, in 3-decimal precision

Re: Demystifying Floating Point Precision

#28

I try to avoid using floats when doing business calculations. Base 2 doesn't work well with our base 10 currency. Real world example: 1.09 - 1.09375 Double: 0.00374999999999992 Decimal: 0.00375

Base 2 doesn’t work well with military too:

http://www-users.math.umn.edu/~arnold/disasters/patriot.html

Re: Demystifying Floating Point Precision

#29
post #21

I've always thought that floats should be accompanied with a precision value specifying the number of significant digits. Ideally updated by hardware in the same operation. All floating point code has subtle bugs if you don't track error accumulation.

This sounds like unums, a proposed alternative to IEEE floats, where roughly speaking the significand can have variable size thus only boasting as much precision as the accuracy warrants.

Does it solve the equality issue? An epsilon tracker would allow you to say it's equal within the margin of error for the computation.

If so that makes them much more interesting to me. Floating point bugs manifest themselves at non linear parts such as equality and comparison operators.

Re: Demystifying Floating Point Precision

#30
post #16

Earlier quoted context omitted.

He has some videos that are commentated by voice, but for some reason he finds doing the recordings very stressful, so most of his content is unfortunately on his 'uncommentated' channel. I agree it would be nice to have the voice-overs

He could be writing blog posts and making videos to supplement. His writing isn't bad.

I guess he finds it much easier to just dump it all onto Youtube for hosting and ads, rather than deal with setting up his own blog hosting for it.
Post reply on HN