aboutsummaryrefslogtreecommitdiff
path: root/newlib/libm
diff options
context:
space:
mode:
authorAndoni Arregi <andoni.arregui@gtd-gmbh.de>2022-02-11 12:16:00 +0100
committerCorinna Vinschen <corinna@vinschen.de>2022-02-14 14:44:11 +0100
commitec69debcb977d6395f9e91ee20133de473484e20 (patch)
tree6ece15967669d02dabff3edee6819349c8fb4d25 /newlib/libm
parentdd653423157b49ebe0c07f692cf8ba483b76e8b7 (diff)
downloadnewlib-ec69debcb977d6395f9e91ee20133de473484e20.zip
newlib-ec69debcb977d6395f9e91ee20133de473484e20.tar.gz
newlib-ec69debcb977d6395f9e91ee20133de473484e20.tar.bz2
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)
Diffstat (limited to 'newlib/libm')
-rw-r--r--newlib/libm/math/erf_lgamma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/libm/math/erf_lgamma.c b/newlib/libm/math/erf_lgamma.c
index f88f630..84d0215 100644
--- a/newlib/libm/math/erf_lgamma.c
+++ b/newlib/libm/math/erf_lgamma.c
@@ -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);