3 ms·
John Gustafson's unums are an effort to introduce a scheme for bitwise reproducible floats.
by dnautics 11y ago
John Gustafson's unums are an effort to introduce a scheme for bitwise reproducible floats.
- yarvin9 11y agoOMG I love this guy and need to have his babies immediately. Some links: http://www.vrworld.com/2015/03/24/the-evils-of-floating-point-and-the-joys-of-unum/2/ http://www.vrworld.com/2015/03/24/the-evils-of-floating-poin... http://sites.ieee.org/scv-cs/files/2013/03/Right-SizingPrecision1.pdf http://sites.ieee.org/scv-cs/files/2013/03/Right-SizingPreci...
- dnautics 11y agoI'm currently working on a Julia implementation of unums that supports environments {0,0} -> {6,11}. It will be public soon (next few weeks or so). I'm finished with addition, subtraction, multiplication, and division is not done (I'm working on it today), but the division algo works quite nicely. It is however, really slow (about 40x slower than bigfloat)... One interesting thing, John and I had an argument about the implementation, because there is one part about it that really sucks. Eventually he admitted that it had rankled him too and that the reason why he made this design choice was so that float64 could bitwise map smoothly onto unum{4,6} and float32 onto unum{4,5}... And that people would actually refuse to use unums if not for this direct bitwise mapping! So I capitulated.
- jacobolus 11y ago> there is one part about it that really sucks Don’t leave us hanging! What is the part that really sucks?
- dnautics 11y agoThe spec has an asymmetric exponent bias. IEEE floating points have an asymmetric exponent bias - for example float64 has 1022 bias (symmetric would be a 1023 bias). Because of the properties of unums, the universal representation of the value 1 is subnormal, and subnormals are tricky to deal with. If unums had symmetric exponent biases, then there would not be multiple representations of one.
- bsder 11y ago> One interesting thing, John and I had an argument about the implementation, because there is one part about it that really sucks. And which part would that be? I'm mostly asking out of curiosity, so don't put yourself out if the answer is too long and involved. As someone who has implemented a couple FPUs, I can assure you that there are quite a few pieces of IEEE 754 that suck to implement.
- bsder 11y agoThis is cool, but we can't seem to get floating point decimal jammed into languages. And that has an immediate business case. I would love to have floating point decimal on embedded systems rather than a binary floating point unit. But the libraries are generally huge. I use the equivalent of decimals WAY more on embedded hardware. User entry is always decimal. Percentages--decimal. Time specifications--milliseconds, microseconds, nanoseconds--decimal with precision. I wind up writing integer fixed-point arithmetic versions of this crap, over and over and over. Maybe since Moore's law broke and memory transistors are now way more expensive that processor transistors, we'll get decimal floating point as a feature soon. I won't hold my breath, though.
- dnautics 11y agoFixed-precision is much better for business uses. What, exactly is the benefit of floating point decimal? If you want to divide a $100 venmo three ways, you get to know that your 1/3 is carried to 12 decimal places instead of 2?
- bsder 11y agoFixed-precision is fine. Until your quantum isn't good enough. We only store to hundredths ... oops ... new regulations require us to decimal round to thousandths. Cue full reload of the database with all your numbers in them. Or, even better, try dealing with mm and mils in the same CAD database simultaneously. (conversion factor of 25.4--a clean number in decimal but very much not in binary) In addition, you forget that simply adding decimals doesn't work in binary floating point. Adding 0.10 10 times doesn't equal 1.00 in binary floating point no matter how much precision you use.
- JesperRavn 11y agoGiven that floats are already bitwise reproducible (provided the compiler is appropriately shackled), what does this idea add to reproducibility?