Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: math function accuracy -- was Re: text2interval again /



On 2013-03-12 08:14:16 +0000, N.M. Maclaren wrote:
> 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.

Say, you compute sin(10^22) on two different x86 machines:
  _ 32 bits: 0.46261304076460175
  _ 64 bits: -0.85220084976718879

What benefit do you get if you don't know which one is the
"correct" result (if there is any)? (And if you already know
it, you don't need a program to compute it.)

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)