Re: math function accuracy -- was Re: text2interval again /
On Mar 12 2013, Vincent Lefevre wrote:
I'm not saying that P1788 should demand tightest. On the contrary.
What I'm saying is that even if P1788 just demands containment,
a program will benefit from implementations providing a good
accuracy. This is not true for floating-point: a C program has
no way to compute an error bound on some result, because C doesn't
have any requirement concerning the accuracy of math functions;
even if the result is accurate, the program cannot know this in
a portable way.
No, that isn't true. Floating-point programs do benefit from more
accurate special functions, whether or not they calculate the error
bounds. Also, there are ways to compute error bounds, but I agree
that they are painful and very dependent on the algorithm.
Also note that a P1788 implementation can provide several versions
of a function, e.g. one tightest, one accurate and one valid. So
depending on his speed/accuracy compromise, a user could choose
the best version for his application.
That's been tried, dozens of times, and has never worked. The human
factor is important.
Regards,
Nick Maclaren.