diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2013-04-28 15:21:50 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2013-04-28 15:21:50 +0000 |
commit | c19459a92177fc8864b461e84d017a21c4006dc5 (patch) | |
tree | fcf20ad0222de01ad3a955edb3b65b06724a3a15 /libc/sysdeps/ieee754/ldbl-128/e_j0l.c | |
parent | 8751114637bcc3caaf16a4216da0afb84456558a (diff) | |
download | eglibc2-c19459a92177fc8864b461e84d017a21c4006dc5.tar.gz |
Merge changes between r22663 and r22954 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@22955 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/ieee754/ldbl-128/e_j0l.c')
-rw-r--r-- | libc/sysdeps/ieee754/ldbl-128/e_j0l.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/libc/sysdeps/ieee754/ldbl-128/e_j0l.c b/libc/sysdeps/ieee754/ldbl-128/e_j0l.c index 9e7880c49..108eff443 100644 --- a/libc/sysdeps/ieee754/ldbl-128/e_j0l.c +++ b/libc/sysdeps/ieee754/ldbl-128/e_j0l.c @@ -93,6 +93,7 @@ #include <math.h> #include <math_private.h> +#include <float.h> /* 1 / sqrt(pi) */ static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L; @@ -710,11 +711,14 @@ __ieee754_j0l (long double x) __sincosl (xx, &s, &c); ss = s - c; cc = s + c; - z = -__cosl (xx + xx); - if ((s * c) < 0) - cc = z / ss; - else - ss = z / cc; + if (xx <= LDBL_MAX / 2.0L) + { + z = -__cosl (xx + xx); + if ((s * c) < 0) + cc = z / ss; + else + ss = z / cc; + } if (xx > 0x1p256L) return ONEOSQPI * cc / __ieee754_sqrtl (xx); @@ -857,11 +861,14 @@ long double __sincosl (x, &s, &c); ss = s - c; cc = s + c; - z = -__cosl (x + x); - if ((s * c) < 0) - cc = z / ss; - else - ss = z / cc; + if (xx <= LDBL_MAX / 2.0L) + { + z = -__cosl (x + x); + if ((s * c) < 0) + cc = z / ss; + else + ss = z / cc; + } if (xx > 0x1p256L) return ONEOSQPI * ss / __ieee754_sqrtl (x); |