Results of cos(pi/2) tests are dependent on error rounding pi/2 to a type.

Carlos O'Donell carlos@redhat.com
Fri Apr 12 07:02:00 GMT 2013


On 04/11/2013 01:44 PM, Andreas Schwab wrote:
> I'm getting this result on ppc for long double:
> 
> Failure: Test: cos (pi/2) == 1.082856673921913968223746169860580e-32
> Result:
>  is:          1.08285667392191396822e-32   0x1.c1cd129024e088a67cc7p-107
>  should be:   1.08285667392191396822e-32   0x1.c1cd129024e088a67cc7p-107
>  difference:  5.71253355584909492648e-62   0x1.78000000000000000000p-204
>  ulp       :  376.0000
>  max.ulp   :  0.0000
> Maximal error of `cos'
>  is      : 376 ulp
>  accepted: 1 ulp
> Failure: Test: sincos (pi/2, &sin_res, &cos_res) puts 1.082856673921913968223746169860580e-32 in cos_res
> Result:
>  is:          1.08285667392191396822e-32   0x1.c1cd129024e088a67cc7p-107
>  should be:   1.08285667392191396822e-32   0x1.c1cd129024e088a67cc7p-107
>  difference:  5.71253355584909492648e-62   0x1.78000000000000000000p-204
>  ulp       :  376.0000
>  max.ulp   :  0.0000
> Maximal error of `sincos'
>  is      : 376 ulp
>  accepted: 1 ulp
> 
> Filed as PR15359.

Could you print the following for me?

printf ("%.100000g\n", (long double)(M_PIl/2.0L));

The most likely scenario is that I lost digits of precision when using only %.100Le.

I'm trying to get my hands on a fast ppc box to test stuff on.

Cheers,
Carlos.



More information about the Libc-alpha mailing list