diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/k_tanl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-96/k_tanl.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sysdeps/ieee754/ldbl-96/k_tanl.c b/sysdeps/ieee754/ldbl-96/k_tanl.c index 31cd236aa2..0c050c112f 100644 --- a/sysdeps/ieee754/ldbl-96/k_tanl.c +++ b/sysdeps/ieee754/ldbl-96/k_tanl.c @@ -56,6 +56,8 @@ * = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y))) */ +#include <float.h> +#include <libc-internal.h> #include <math.h> #include <math_private.h> static const long double @@ -94,8 +96,13 @@ __kernel_tanl (long double x, long double y, int iy) { /* generate inexact */ if (x == 0 && iy == -1) return one / fabsl (x); + else if (iy == 1) + { + math_check_force_underflow_nonneg (absx); + return x; + } else - return (iy == 1) ? x : -one / x; + return -one / x; } } if (absx >= 0.6743316650390625L) @@ -126,8 +133,15 @@ __kernel_tanl (long double x, long double y, int iy) { v = (long double) iy; w = (v - 2.0 * (x - (w * w / (w + v) - r))); + /* SIGN is set for arguments that reach this code, but not + otherwise, resulting in warnings that it may be used + uninitialized although in the cases where it is used it has + always been set. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_NEEDS_COMMENT (4.8, "-Wmaybe-uninitialized"); if (sign < 0) w = -w; + DIAG_POP_NEEDS_COMMENT; return w; } if (iy == 1) |