diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-128')
-rw-r--r-- | sysdeps/ieee754/ldbl-128/k_sincosl.c | 20 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/k_sinl.c | 10 |
2 files changed, 23 insertions, 7 deletions
diff --git a/sysdeps/ieee754/ldbl-128/k_sincosl.c b/sysdeps/ieee754/ldbl-128/k_sincosl.c index 2f66dee6d8..7b5c4b0e81 100644 --- a/sysdeps/ieee754/ldbl-128/k_sincosl.c +++ b/sysdeps/ieee754/ldbl-128/k_sincosl.c @@ -17,6 +17,7 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#include <float.h> #include <math.h> #include <math_private.h> @@ -109,12 +110,19 @@ __kernel_sincosl(long double x, long double y, long double *sinx, long double *c /* Argument is small enough to approximate it by a Chebyshev polynomial of degree 16(17). */ if (tix < 0x3fc60000) /* |x| < 2^-57 */ - if (!((int)x)) /* generate inexact */ - { - *sinx = x; - *cosx = ONE; - return; - } + { + if (fabsl (x) < LDBL_MIN) + { + long double force_underflow = x * x; + math_force_eval (force_underflow); + } + if (!((int)x)) /* generate inexact */ + { + *sinx = x; + *cosx = ONE; + return; + } + } z = x * x; *sinx = x + (x * (z*(SIN1+z*(SIN2+z*(SIN3+z*(SIN4+ z*(SIN5+z*(SIN6+z*(SIN7+z*SIN8))))))))); diff --git a/sysdeps/ieee754/ldbl-128/k_sinl.c b/sysdeps/ieee754/ldbl-128/k_sinl.c index b15521badf..04d539ff1a 100644 --- a/sysdeps/ieee754/ldbl-128/k_sinl.c +++ b/sysdeps/ieee754/ldbl-128/k_sinl.c @@ -17,6 +17,7 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#include <float.h> #include <math.h> #include <math_private.h> @@ -90,7 +91,14 @@ __kernel_sinl(long double x, long double y, int iy) /* Argument is small enough to approximate it by a Chebyshev polynomial of degree 17. */ if (tix < 0x3fc60000) /* |x| < 2^-57 */ - if (!((int)x)) return x; /* generate inexact */ + { + if (fabsl (x) < LDBL_MIN) + { + long double force_underflow = x * x; + math_force_eval (force_underflow); + } + if (!((int)x)) return x; /* generate inexact */ + } z = x * x; return x + (x * (z*(SIN1+z*(SIN2+z*(SIN3+z*(SIN4+ z*(SIN5+z*(SIN6+z*(SIN7+z*SIN8))))))))); |