On Sun, 4 Nov 2018, Ed Smith-Rowland wrote: > I looked in glibc. Unfortunately, I see how they have the same mistake: > glibc/math/w_tgammal_compat.c: > long double > __tgammal(long double x) > { > int local_signgam; > long double y = __ieee754_gammal_r(x,&local_signgam); > ... > return local_signgam < 0 ? - y : y; > } > I'm very sure this is where tgammaq came from. > Ditto for glibc/math/w_tgamma_compat.c and glibc/math/w_tgammaf_compat.c.
No, that's not a mistake. __ieee754_gammal_r returns +/- the gamma function and sets the integer pointed to by the second argument to indicate whether to negate the result. (This isn't a particularly good interface design for tgamma, as opposed to lgamma; unfortunately __gammal_r_finite, with this interface, is a public ABI.) -- Joseph S. Myers jos...@codesourcery.com