about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/ieee754/ldbl-128ibm/e_logl.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c7b198d54..ec8807cfac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2015-12-09  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #19351]
+	* sysdeps/ieee754/ldbl-128ibm/e_logl.c (__ieee754_logl): When
+	expanding log(1+z), compare z rather than its square with epsilon
+	to determine when to avoid evaluating the expansion.
+
 	[BZ #19350]
 	* sysdeps/ieee754/ldbl-128ibm/e_sinhl.c (__ieee754_sinhl):
 	Increase overflow threshold.
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_logl.c b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
index dcac38062c..14acfc2db7 100644
--- a/sysdeps/ieee754/ldbl-128ibm/e_logl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/e_logl.c
@@ -270,7 +270,7 @@ __ieee754_logl(long double x)
   /* Series expansion of log(1+z).  */
   w = z * z;
   /* Avoid spurious underflows.  */
-  if (__glibc_unlikely(w <= ldbl_epsilon))
+  if (__glibc_unlikely (fabsl (z) <= ldbl_epsilon))
     y = 0.0L;
   else
     {