This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Sine and Cosine Accuracy
- From: Andrew Haley <aph at redhat dot com>
- To: Scott Robert Ladd <scott dot ladd at coyotegulch dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 26 May 2005 16:07:45 +0100
- Subject: Re: Sine and Cosine Accuracy
- References: <4295DE66.2050701@coyotegulch.com>
Scott Robert Ladd writes:
>
> The program used is below. I'm very open to suggestions about this
> program, which is a subset of a larger accuracy benchmark I'm writing
> (Subtilis).
Try this:
public class trial
{
static public void main (String[] argv)
{
System.out.println(Math.sin(Math.pow(2.0, 90.0)));
}
}
zapata:~ $ gcj trial.java --main=trial -ffast-math -O
zapata:~ $ ./a.out
1.2379400392853803E27
zapata:~ $ gcj trial.java --main=trial -ffast-math
zapata:~ $ ./a.out
-0.9044312486086016
Andrew.