This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: What is acceptable for -ffast-math? (Was: associative law in combine)

On 30 Jul 2001, Gabriel Dos Reis wrote:
> | Who are you to say that the user wouldn't like the code to be run faster?
> Who are you to say that it is more important to compute wrong and fast
> than computing correctly?

Why do you think it's necessarily wrong?

The _only_ person who can judge whether it's wrong to do so it the person
who wrote the program. He may be happy with the faster code. He's almost
certainly happy if he used "-ffast-math".

> If correctness is not an issue then the fastest way is to avoid the
> computation entirely or return 0.0 unconditionally.

Blather blather. According to your notion of correctness.

> | Note that with the current -ffast-math on x86, for example, gcc will
> | already inline things like "sin()" etc using the x87 instruction directly.
> I don't buy the argument
>   That is broken, then we should break this as well

It's not broken, you silly boy.

THAT IS THE WHOLE REASON FOR THE "-ffast-math" option.

Go back and look at why it was added. Right - exactly so that people could
get _fast_ math, when they do not care about the inexactness that isn't
even an issue for most people.

> As von Neumann said once
>    Numerical computation is too serious to be left to the computer
>    scientist.

Yeah. And as Linus once said: most numerical problems today in pure CPU
cycles are actually 3D games.

Your arguments about "numerical computation" are just silly, as you don't
seem to realize that there are tons of problems where your theoretical
issues are nothing more than noise.

It's not "incorrect" to say that you want the result faster, even if that
result doesn't match your theoretical models.

And remember: in the end, the goodness of _any_ program (including a
compiler) is how well it solves real-world problems. Whether you like the
transformation or not as anumerical scientist has absolutely nothing to do
with that.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]