aboutsummaryrefslogtreecommitdiff
path: root/libquadmath/math/powq.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-11-21 23:55:29 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2012-11-22 00:55:29 +0100
commit7cf8c994b62e1c0f4b48deb4cb300cab5e50aecf (patch)
treefc57edee06bfb00a7b2b91c9ea11ef86e3c7eec7 /libquadmath/math/powq.c
parente4689920bd5ae525d5641c2789dc3dac830f5dd0 (diff)
downloadgcc-7cf8c994b62e1c0f4b48deb4cb300cab5e50aecf.zip
gcc-7cf8c994b62e1c0f4b48deb4cb300cab5e50aecf.tar.gz
gcc-7cf8c994b62e1c0f4b48deb4cb300cab5e50aecf.tar.bz2
atanq.c (atanq): Update from GLIBC.
2012-11-22 David S. Miller <davem@davemloft.net> Tobias Burnus <burnus@net-b.de> Joseph Myers <joseph@codesourcery.com> * math/atanq.c (atanq): Update from GLIBC. Handle tiny and very large arguments properly. * math/j0q.c (y0q): Update from GLIBC. Avoid arithmetic underflow when 'x' is very small. * math/j1q.c (y1q): Ditto. * math/log1pq.c (log1pq): Update from GLIBC. Saturate nonzero exponents with absolute value below 0x1p-128 to +/- 0x1p-128. * math/powq.c (powq): Update from GLIBC. If xm1 is smaller than LDBL_EPSILON/2.0L, just return xm1. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> Co-Authored-By: Tobias Burnus <burnus@net-b.de> From-SVN: r193716
Diffstat (limited to 'libquadmath/math/powq.c')
-rw-r--r--libquadmath/math/powq.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libquadmath/math/powq.c b/libquadmath/math/powq.c
index 12b87d5..dd44b7c 100644
--- a/libquadmath/math/powq.c
+++ b/libquadmath/math/powq.c
@@ -148,7 +148,7 @@ powq (__float128 x, __float128 y)
{
__float128 z, ax, z_h, z_l, p_h, p_l;
__float128 y1, t1, t2, r, s, t, u, v, w;
- __float128 s2, s_h, s_l, t_h, t_l;
+ __float128 s2, s_h, s_l, t_h, t_l, ay;
int32_t i, j, k, yisint, n;
uint32_t ix, iy;
int32_t hx, hy;
@@ -281,6 +281,10 @@ powq (__float128 x, __float128 y)
return (hy > 0) ? huge * huge : tiny * tiny;
}
+ ay = y > 0 ? y : -y;
+ if (ay < 0x1p-128)
+ y = y < 0 ? -0x1p-128 : 0x1p-128;
+
n = 0;
/* take care subnormal number */
if (ix < 0x00010000)