Re:C library for multiple-precision floating-point arithmeti...
by gnulinux on Friday June 03, 2022 @04:52PM
(#31613462)
In a big application, wouldn't rounding to a random direction (a feature GNU MP supports) be the most accurate probabilistically? If you round up or down all your numbers and you perform a lot of arithmetic operations, you create a lot of bias.
[ Parent
| on HN ]
Re:C library for multiple-precision floating-point arithmeti...
by klyrs on Friday June 03, 2022 @07:47PM
(#31615251)
Consider the logarithm. In almost any interval, rounding down will be more accurate than rounding up the majority of the time -- so random rounding will bias you away from an accurate result. Random rounding can be a good idea, but it's not always a good idea. Random rounding is an okay default, but having fine-grain control over rounding direction is vastly superior to always sticking to the default.
For another example, interval arithmetic is a really cool approach to keeping an eye on your accuracy. There, you want to round your upper bounds up, and round your lower bounds down.
Re:C library for multiple-precision floating-point arithmeti...
by pertymcpert on Friday June 03, 2022 @05:08PM
(#31613630)
Maybe, but having random "accurate" behavior in a program is generally worse than being incorrect all of the time.