Re:Herbie: Automatically Improving Floating Point Accuracy
by contravariant on Thursday August 06, 2020 @07:36PM
(#24076539)
I see. I guess it ends up doing something a bit unexpected because the distribution it's sampling from is quite different from the numbers people often deal with (also unlike the example on the main page it can apparently fail to find a function that is more accurate for all inputs).
Also this is a bit of a special case because it's easy to show that x - x^2 / 2 is within 10^-15 of the true value provided abs(x) is within 10^-6 or so, so it's easy to figure out how good Herbie is doing.
Re:Herbie: Automatically Improving Floating Point Accuracy
by pavpanchekha on Friday August 07, 2020 @11:38AM
(#24083037)
That's right, the implicit distribution is uniform over floating-point values, so for example about a quarter of samples are between -1e-150 and 1e-150.
Also note that the Herbie web demo has some options set that make it fast (to handle load) at the cost of lower accuracy. For example, if you download and install it yourself, you can turn on support for the special numeric functions (like log1p) or increase the number of search iterations done.