From ae63c7ebedcaa57017df4cb8ff0494a4705321ee Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 8 Apr 2015 17:14:12 +0000 Subject: Fix dbl-64 atan in non-default rounding modes (bug 18197). The dbl-64 implementation of atan does computations that expect to run in round-to-nearest mode, and in other modes the errors can accumulate to more than the maximum accepted 9ulp. This patch makes it use FE_TONEAREST internally, similar to other functions with such issues. Tested for x86_64 and x86; no ulps updates needed. [BZ #18197] * sysdeps/ieee754/dbl-64/s_atan.c: Include . (atan): Set FE_TONEAREST mode for internal computations. * math/auto-libm-test-in: Add more tests of atan. * math/auto-libm-test-out: Regenerated. --- sysdeps/ieee754/dbl-64/s_atan.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sysdeps') diff --git a/sysdeps/ieee754/dbl-64/s_atan.c b/sysdeps/ieee754/dbl-64/s_atan.c index 7b598f1..5035ae8 100644 --- a/sysdeps/ieee754/dbl-64/s_atan.c +++ b/sysdeps/ieee754/dbl-64/s_atan.c @@ -41,6 +41,7 @@ #include "MathLib.h" #include "uatan.tbl" #include "atnat.h" +#include #include #include #include @@ -81,6 +82,7 @@ atan (double x) return x + x; /* Regular values of x, including denormals +-0 and +-INF */ + SET_RESTORE_ROUND (FE_TONEAREST); u = (x < 0) ? -x : x; if (u < C) { -- cgit v1.1