csinf and cacoshf failures on LoongArch

Paul Zimmermann Paul.Zimmermann@inria.fr
Thu Nov 7 14:38:28 GMT 2024


       Hi Xi,

> When testing log10f fix on LoongArch, I got some other failures in csinf
> and cacoshf:
> 
> testing float (without inline functions)
> Failure: Test: Imaginary part of: csin (0xcp-4 + 0x1.4p+0 i)
> Result:
>  is:          1.17210627e+00   0x1.2c0f28p+0
>  should be:   1.17210639e+00   0x1.2c0f2ap+0
>  difference:  1.19209290e-07   0x1.000000p-23
>  ulp       :  1.0000
>  max.ulp   :  0.0000
> Maximal error of real part of: csin
>  is      : 1 ulp
>  accepted: 1 ulp
> Maximal error of imaginary part of: csin
>  is      : 1 ulp
>  accepted: 0 ulp

a maximal error of 0 ulp for the imaginary part looks strange.
In our comparison of complex functions [1] we get an error of 2 ulps
for this input:

csin 0 -1 0x1.23fa3ap+119,-0x1.6f719ap-1 [2.76] 2.75954 2.75953966657537
libm gives (-0x1.67a568p-1,-0x1.4cf17p-1)
mpc gives (-0x1.67a56cp-1,-0x1.4cf174p-1)

> testing float (without inline functions)
> Failure: Test: Real part of: cacosh_upward (-0x2p-24 - 0x8p-4 i)
> Result:
>  is:          4.81211961e-01   0x1.ecc2d4p-2
>  should be:   4.81211842e-01   0x1.ecc2ccp-2
>  difference:  1.19209290e-07   0x1.000000p-23
>  ulp       :  4.0000
>  max.ulp   :  3.0000
> Failure: Test: Real part of: cacosh_upward (-0x2p-24 + 0x8p-4 i)
> Result:
>  is:          4.81211961e-01   0x1.ecc2d4p-2
>  should be:   4.81211842e-01   0x1.ecc2ccp-2
>  difference:  1.19209290e-07   0x1.000000p-23
>  ulp       :  4.0000
>  max.ulp   :  3.0000
> Failure: Test: Real part of: cacosh_upward (0x2p-24 - 0x8p-4 i)
> Result:
>  is:          4.81211961e-01   0x1.ecc2d4p-2
>  should be:   4.81211842e-01   0x1.ecc2ccp-2
>  difference:  1.19209290e-07   0x1.000000p-23
>  ulp       :  4.0000
>  max.ulp   :  3.0000
> Failure: Test: Real part of: cacosh_upward (0x2p-24 + 0x8p-4 i)
> Result:
>  is:          4.81211961e-01   0x1.ecc2d4p-2
>  should be:   4.81211842e-01   0x1.ecc2ccp-2
>  difference:  1.19209290e-07   0x1.000000p-23
>  ulp       :  4.0000
>  max.ulp   :  3.0000
> Maximal error of real part of: cacosh_upward
>  is      : 4 ulp
>  accepted: 3 ulp

same for the real part of cacosh, where we get 7 ulps:

cacosh 0 -1 0x1.01ff66p+0,0x1.17fcfap-12 [7.26] 7.25492 7.25491835247449
libm gives (0x1.ff7134p-4,0x1.17911ap-9)
mpc gives (0x1.ff7126p-4,0x1.17911ep-9)

> Maximal error of imaginary part of: cacosh_upward
>  is      : 2 ulp
>  accepted: 2 ulp
> 
> Do you guys think we should just update ulps or do a bisect to see
> when/how the precision was regressed?

I guess we should update ulps, and add the above two inputs.

Best regards,
Paul

[1] https://inria.hal.science/hal-04714173


More information about the Libc-alpha mailing list