issue in cacoshf?

Paul Zimmermann Paul.Zimmermann@inria.fr
Wed Sep 11 12:21:10 GMT 2024


thank you Andreas and Alexander, and sorry for the noise.

Paul

> Date: Wed, 11 Sep 2024 14:19:12 +0300 (MSK)
> From: Alexander Monakov <amonakov@ispras.ru>
> cc: Paul Zimmermann <Paul.Zimmermann@inria.fr>, libc-alpha@sourceware.org
> 
> 
> On Wed, 11 Sep 2024, Andreas Schwab wrote:
> 
> > On Sep 11 2024, Paul Zimmermann wrote:
> > 
> > > I get with the GNU libc:
> > >
> > > $ gcc -DFOO=acosh check_cacosh2.c -lm
> > > $ ./a.out 
> > > Xbest=-0x0p+0 Ybest=-0x0p+0
> > > libm gives (0x0p+0,0x1.921fb6p+0)
> > >
> > > thus we get (0,pi/2), whereas GNU MPC returns (0,-pi/2) instead.
> > >
> > > Can someone confirm this is a bug?
> > 
> > Is cacosh actually called with -0-i0?
> 
> No, due to (unnecessary) casts in
> 
>   CTYPE z_in = (CTYPE) Xbest + I * (CTYPE) Ybest;
> 
> the RHS in the addition has +0.0f as the real part, so the real part of
> the result is +0.0f as well. Likewise for the imaginary part. Without casts:
> 
>   CTYPE z_in = Xbest + I * Ybest;
> 
> it works as expected.
> 
> Alexander
> 


More information about the Libc-alpha mailing list