From 6f05bafebac30a389807979f8efbb709f84b486f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 2 Apr 2014 13:10:19 +0000 Subject: Fix clog / clog10 sign of zero result in round-downward mode (bug 16789). This patch fixes bug 16789, incorrect sign of (real part) zero result from clog and clog10 in round-downward mode, arising from that real part being computed as 0 - 0. To ensure that an underflow exception occurred, the code used an underflowing value (the next term in the series for log1p) in arithmetic computing the real part of the result, yielding the problematic 0 - 0 computation in some cases even when the mathematical result would be small but positive. The patch changes this code to use the math_force_eval approach to ensuring that an underflowing computation actually occurs. Tests of clog and clog10 are enabled in all rounding modes. Tested x86_64 and x86 and ulps updated accordingly. [BZ #16789] * math/s_clog.c (__clog): Use math_force_eval to ensure underflow instead of using underflowing value in computing result. * math/s_clog10.c (__clog10): Likewise. * math/s_clog10f.c (__clog10f): Likewise. * math/s_clog10l.c (__clog10l): Likewise. * math/s_clogf.c (__clogf): Likewise. * math/s_clogl.c (__clogl): Likewise. * math/libm-test.inc (clog_test): Use ALL_RM_TEST. (clog10_test): Likewise. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise. --- ChangeLog | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index f623e8b..4a51456 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2014-04-02 Joseph Myers + + [BZ #16789] + * math/s_clog.c (__clog): Use math_force_eval to ensure underflow + instead of using underflowing value in computing result. + * math/s_clog10.c (__clog10): Likewise. + * math/s_clog10f.c (__clog10f): Likewise. + * math/s_clog10l.c (__clog10l): Likewise. + * math/s_clogf.c (__clogf): Likewise. + * math/s_clogl.c (__clogl): Likewise. + * math/libm-test.inc (clog_test): Use ALL_RM_TEST. + (clog10_test): Likewise. + * sysdeps/i386/fpu/libm-test-ulps: Update. + * sysdeps/x86_64/fpu/libm-test-ulps: Likewise. + 2014-04-02 Alan Modra [BZ #16739] -- cgit v1.1