about summary refs log tree commit diff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-11-16 09:31:38 -0800
committerDavid S. Miller <davem@davemloft.net>2012-11-16 09:31:38 -0800
commit447885ebf1c1fc8adf4084f5e2708ff84d0da43b (patch)
tree95a48aa60e330d4afc6de73d70879e9e52ca47ff /sysdeps/ieee754
parentbcbf9830b735acdd9b0d49fe96da73dfacfa17d0 (diff)
downloadglibc-447885ebf1c1fc8adf4084f5e2708ff84d0da43b.tar.gz
glibc-447885ebf1c1fc8adf4084f5e2708ff84d0da43b.tar.xz
glibc-447885ebf1c1fc8adf4084f5e2708ff84d0da43b.zip
Don't generate underflow for very small values in log1pl.
	* sysdeps/ieee754/ldbl-128/s_log1pl.c (__log1pl): If xm1 is
	smaller than LDBL_EPSILON/2.0L, just return xm1.
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_log1pl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_log1pl.c b/sysdeps/ieee754/ldbl-128/s_log1pl.c
index 4ecea0fddd..fad18e9da2 100644
--- a/sysdeps/ieee754/ldbl-128/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128/s_log1pl.c
@@ -138,6 +138,12 @@ __log1pl (long double xm1)
       && (u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
     return xm1;
 
+  if ((hx & 0x7fffffff) < 0x3f8e0000)
+    {
+      if ((int) xm1 == 0)
+	return xm1;
+    }
+
   x = xm1 + 1.0L;
 
   /* log1p(-1) = -inf */