Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The example where computing an expression with posits has much better accuracy than when computing with IEEE FP32 is extremely misleading.

Regardless whether you use 32-bit posits or IEEE FP32, you can represent only the same count of numbers, i.e. of points on the "real" numbers axis.

When choosing a representation format, you cannot change the number of representable points, you can just choose to distribute the points in different places.

The IEEE FP32 format distributes the points so that the relative rounding error is approximately constant over the entire range.

Posits crowd the points into the segment close to zero, obtaining there a better rounding error, with the price that the segments distant to zero have very rare points, i.e. very high rounding errors.

Posits behave pretty much like a fixed-point format that has gradual overflow instead of a sharp cut-off. For big numbers you do not get an overflow exception that would stop the computation, but the accuracy of the results becomes very bad. For small numbers the accuracy is good, but not as good as for a fixed-point number, because some bit patterns must be reserved for representing the big numbers, in order to avoid overflow.

The example that demonstrates better accuracy for posits is manufactured by choosing values in the range where posits have better accuracy. It is trivial to manufacture an almost identical example where posits have worse accuracy, by choosing values in an interval where FP32 has better accuracy.

There are indeed problems where posits can outperform IEEE FP32, but it is quite difficult to predict which are those problems, because for a complex problem it can be very difficult to predict which will be the ranges for the intermediate results. This is the very reason why floating-point numbers are preferred over fixed-point numbers, to avoid the necessity of such analyses.

While for IEEE formats it is possible to make estimates of the relative errors of the results of a long computation, due to the guaranteed bounds for the relative error of each operation, that is pretty much impossible for posits, where the relative error is a function of the values of the operands, so you cannot estimate it without actually doing the computation.

For scientific and technical computations, posits are pretty much useless, because those have very wide value ranges for their data, also because those computations need error estimations, and also because posits can have significant advantages only for small number formats, of 32 bits or less, while those computations need mostly 64-bit numbers or even bigger.

Nevertheless, for special problems that are very well characterized, i.e. you know with certainty some narrow ranges for the values of the input data and of the intermediate results, posits could get much more accuracy than IEEE FP32, but they could have good performance only if they were implemented in hardware.



Isn’t that pretty much the entire point of this article?


> The example where computing an expression with posits has much better accuracy than when computing with IEEE FP32 is extremely misleading.

Did you not rtfa or am I missing something?


practically speaking we did put this to the test by having someone run a fluid dynamics simulation on fp64 vs posit64 vs posit32 with no algorithm changes (using fp128 as a "ground truth").

unsurprisingly posit64 results were closer to fp128 than fp64.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: