diff options
author | Tobias Burnus <burnus@net-b.de> | 2012-11-02 17:59:30 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-11-02 17:59:30 +0100 |
commit | e4320d7da0bc4987254988c321b0e8d8c90d0e55 (patch) | |
tree | 3926f14e41a87d8ec72a6c34a19e95e7035654f7 /libquadmath/math/lgammaq.c | |
parent | f2a1b46987236a338f9cd96fa42b64af9ffb5a80 (diff) | |
download | gcc-e4320d7da0bc4987254988c321b0e8d8c90d0e55.tar.gz |
fmaq.c (fmaq): Merge from GLIBC.
2012-11-01 Tobias Burnus <burnus@net-b.de>
Joseph Myers <joseph@codesourcery.com>
* math/fmaq.c (fmaq): Merge from GLIBC. Handle cases
with small x * y using scaling, not as x * y + z.
* math/lgammaq.c (lgammaq): Fix signgam handling.
Co-Authored-By: Joseph Myers <joseph@codesourcery.com>
From-SVN: r193099
Diffstat (limited to 'libquadmath/math/lgammaq.c')
-rw-r--r-- | libquadmath/math/lgammaq.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libquadmath/math/lgammaq.c b/libquadmath/math/lgammaq.c index 361f7037bc3..485939af1b4 100644 --- a/libquadmath/math/lgammaq.c +++ b/libquadmath/math/lgammaq.c @@ -759,7 +759,8 @@ lgammaq (__float128 x) { __float128 p, q, w, z, nx; int i, nn; - int sign; + + signgam = 1; if (! finiteq (x)) return x * x; @@ -767,11 +768,9 @@ lgammaq (__float128 x) if (x == 0.0Q) { if (signbitq (x)) - sign = -1; + signgam = -1; } - signgam = sign; - if (x < 0.0Q) { q = -x; @@ -780,9 +779,9 @@ lgammaq (__float128 x) return (one / (p - p)); i = p; if ((i & 1) == 0) - sign = -1; + signgam = -1; else - sign = 1; + signgam = 1; z = q - p; if (z > 0.5Q) { @@ -790,10 +789,8 @@ lgammaq (__float128 x) z = p - q; } z = q * sinq (PIQ * z); - signgam = sign; - if (z == 0.0Q) - return (sign * huge * huge); + return (signgam * huge * huge); w = lgammaq (q); z = logq (PIQ / z) - w; return (z); @@ -1025,7 +1022,7 @@ lgammaq (__float128 x) } if (x > MAXLGM) - return (sign * huge * huge); + return (signgam * huge * huge); q = ls2pi - x; q = (x - 0.5Q) * logq (x) + q; |