libjava configure question
Andrew Haley
aph@redhat.com
Wed May 25 15:37:00 GMT 2005
Bryce McKinlay writes:
>
> In fact GCJ already has the ability to inline Math.* calls directly
> into native FPU instructions in some cases.
One other thing: I don't think we can do this in general and meet even
the more relaxed requirements of java.lang.Math, because the x86 has a
restricted range of allowable arguments to its trig functions.
Try this with -ffast-math:
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
I think that we can agree the error is more than 1 ulp!
Andrew.
More information about the Java
mailing list