Improve lgammaf range for very small cases

The original cut for small arguments at |x|<2**-70 (copied from the
double version) produces that when computing nadj we get a subnormal
number for t*x and thus, the division of pi/subnormal will be INF and
the logarithm of it too, which is wrong as a result for lgammaf in this
range.
The proposed new limit seems to be safe and has been tested to
produce accurate results.
(Courtesy of Andreas Jung, ESA)
This commit is contained in:
Andoni Arregi 2022-02-11 12:16:00 +01:00 committed by Corinna Vinschen
parent dd65342315
commit ec69debcb9
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ static float zero= 0.0000000000e+00;
*signgamp = -1;
return one/(x-x);
}
if(ix<0x1c800000) { /* |x|<2**-70, return -log(|x|) */
if(ix<0x30800000) { /* |x|<2**-30, return -log(|x|) */
if(hx<0) {
*signgamp = -1;
return -__ieee754_logf(-x);