This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- To: Gabriel Dos_Reis <gdosreis at sophia dot inria dot fr>
- Subject: Re: What is acceptable for -ffast-math? (Was: associative law in combine)
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 01 Aug 2001 15:12:27 -0300
- Cc: Linus Torvalds <torvalds at transmeta dot com>, Tim Hollebeek <tim at hollebeek dot com>, Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>, Gabriel Dos Reis <gdr at codesourcery dot com>, <dewar at gnat dot com>, <amylaar at redhat dot com>, <gcc at gcc dot gnu dot org>, <moshier at moshier dot ne dot mediaone dot net>, <tprince at computer dot org>
- Organization: GCC Team, Red Hat
- References: <20010801122417.A2509@cj44686-b.reston1.va.home.com><Pine.LNX.4.33.0108010929020.20829-100000@penguin.transmeta.com><15208.15111.761855.922613@perceval.inria.fr>
On Aug 1, 2001, Gabriel Dos_Reis <gdosreis@sophia.inria.fr> wrote:
> | Now, show me a case where a/b/c -> a/(b*c) is significantly less accurate?
> On a 64-bit double processor just take
> b = c = 2 * sqrt(DBL_MAX);
> a = 0.5 * DBL_MAX
> a/(b*c) is 0.0 whereas a/b/c yields 0.125.
I'm no expert in FP arithmetic, but it appears to me that this chunk
of code is a materialization of what Linus wrote:
> The one obvious case is (b*c) overflows and turns into Inf, at which
> point the end result will be +-0 with the optimization.
If there is a difference, will you care to enlighten me?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me