2 ms·
Let me share my view on those. Posits deal with really large and really small values differently. If I may assume astronomically large values are essentially ov
by phkahler 8y ago
Let me share my view on those. Posits deal with really large and really small values differently. If I may assume astronomically large values are essentially overflow and small are underflow, posits use an actual value for these. Because of the increased dynamic range (and diminishing resolution) large numbers don't go to infinity but to the largest representable number. Underflow go to the smallest non-zero number. As such they both retain their sign AND can be used in subsequent computations. NaN is only the result of division by zero or an operation on a NaN. In my experience - and yours may vary of course - this is exactly how I want such situations to be handled. I don't want NaN as a result, I want the most reasonable thing to put in the rest of the calculations. Part of this comes from wanting high performance and part is from the realization that you can't check flags after every computation. Exceptions IMHO should not be raised if your code is correct.
The guy who came up with posits also has his UNUM concept which I think is interesting but not for me. The idea is to use two numbers (posits) to track an upper and lower bound for a computation. At the end you can then see what confidence you have in the result. To me that's just wasted storage and computation, but if you want to validate some complex code it actually seems better to me than having some NaN come out the end.
I think of UNUMs and posits as two different ideas. Posits work the way I want them to, while UNUMs will provide the features you want (correctness checking) weather they use posits or IEEE floating point as the underlying representation.
If you consider the two goals of high performance and correctness of a computation, I think UNUMs and posits handle it far more elegantly and simply. IEEE doesn't actually give you both at the same time, but it pretends to.