GNU C Library master sources branch master updated. glibc-2.22-587-gca2fcac

jsm28@sourceware.org jsm28@sourceware.org
Wed Dec 9 21:20:00 GMT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  ca2fcac629b9b7781ccd52685b28741d89ff128f (commit)
      from  e5a5315e2d290fe34e0fb80996c713b8b802dcc9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ca2fcac629b9b7781ccd52685b28741d89ff128f

commit ca2fcac629b9b7781ccd52685b28741d89ff128f
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Dec 9 21:20:18 2015 +0000

    Fix ldbl-128ibm tanhl inaccuracy for small arguments (bug 19349).
    
    The ldbl-128ibm implementation of tanhl is inaccurate for small
    arguments, because it returns x*(1+x) (maybe in an attempt to raise
    "inexact") when x itself would be the accurate return value but
    multiplying by 1+x introduces large errors.  This patch fixes it to
    return x in that case (when the mathematical result is x plus a
    negligible remainder on the order of x^3) to avoid those errors.
    
    Tested for powerpc.
    
    	[BZ #19349]
    	* sysdeps/ieee754/ldbl-128ibm/s_tanhl.c (__tanhl): Return argument
    	when small.

diff --git a/ChangeLog b/ChangeLog
index b2eddff..b76c54b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-12-09  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #19349]
+	* sysdeps/ieee754/ldbl-128ibm/s_tanhl.c (__tanhl): Return argument
+	when small.
+
 	* sysdeps/unix/sysv/linux/i386/kernel-features.h
 	[__LINUX_KERNEL_VERSION >= 0x040300] (__ASSUME_SOCKET_SYSCALL):
 	New macro.
diff --git a/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c b/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
index 292020c..e6457a1 100644
--- a/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
@@ -69,7 +69,7 @@ long double __tanhl(long double x)
 	    if (ix<0x3c60000000000000LL) 	/* |x|<2**-57 */
 	      {
 		math_check_force_underflow (x);
-		return x*(one+x);    	/* tanh(small) = small */
+		return x;		/* tanh(small) = small */
 	      }
 	    if (ix>=0x3ff0000000000000LL) {	/* |x|>=1  */
 		t = __expm1l(two*fabsl(x));

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                             |    4 ++++
 sysdeps/ieee754/ldbl-128ibm/s_tanhl.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list