This is the mail archive of the
mailing list for the GCC project.
Re: What is acceptable for -ffast-math? A numerical viewpoint
- To: Gabriel Dos Reis <gdr at codesourcery dot com>
- Subject: Re: What is acceptable for -ffast-math? A numerical viewpoint
- From: Wolfgang Bangerth <wolfgang dot bangerth at iwr dot uni-heidelberg dot de>
- Date: Wed, 1 Aug 2001 16:55:02 +0200 (MET DST)
- cc: dewar at gnat dot com, gcc at gcc dot gnu dot org
On 1 Aug 2001, Gabriel Dos Reis wrote:
> | > Finally, as a concrete example, look at the classical problem of
> | > approximating the zeros of a univariate polynomial. There you have
> | > true degragation. Just take the Wilkinson polynomial of 20th degree,
> | > and make slight pertubation to its cofficients (preferably the three
> | > leading cofficients) and see what happens.
> | There you obviously need high and known precision because the
> | problems are unstable. PDE solvers, OTOH, usually use stable
> | methods. It is only for the latter applications that I said it
> | would be useful to have more aggressive/dubious optimizations.
> You seem to believe that we were using unstable methods to approximate
> polynomial roots. That is untrue. We are using stable methods,
> combined with separation algorithms. The trouble is not really the
> methods but the problems at hand: Polynomial roots are very sensitive
> to pertubation to coefficients.
Of course, it's just like nobody uses Gaussian elimination without
pivoting. I understand that it's the problem at hand that makes the
difficulties. That's why I wrote "problems", not "algorithms" :-)
> My point was bring in a concrete conter-example to the claim that, it
> doesn't matter how dubious are the transformations, it suffices to
> use stable algorithms.
So we agree: there are instable problems where -ffast-math makes no sense
because they are too sensitive even when using stable algorithms. And then
there are stable problems where stable methods might profit from
potentially dubious transformations; for these, a/b/c=a/(b*c) and
a*c+b*c=(a+b)*c would make sense.
My intention was just to point out that there are non-negligible branches
of computational maths where the stability of the problems and algorithms
would allow for such transformations and there they'd be useful.
Wolfgang Bangerth email: email@example.com