GCC beaten by ICC in stupid trig test!
Scott Robert Ladd
coyote@coyotegulch.com
Tue Mar 16 12:14:00 GMT 2004
Robert Dewar wrote:
> Indeed if any programmer writes sin**2+cos**2, one can assume that the
> intention is precisely to get the computed value that may not be 1.0. If
> the programmer wants 1.0, they can write it explicitly!
Mathematical identities provide good tests of numerical accuracy; I have
found instances where certain compilers do *not* compute "sin**2+cos**2"
as equal to 1, usually due to a poor implementation of sin and cos.
The actual line of code in question was part of a testing spike, and it
had no effect on the actual subject of the original post, and was not
intended to be part of a production program.
--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing
More information about the Gcc
mailing list