aboutsummaryrefslogtreecommitdiff
path: root/math/k_casinhl.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-01-31 22:55:29 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-01-31 22:55:29 +0000
commit8cf28c5ebe7b02e769a3f3082fd390e6d8c11542 (patch)
treebe283a6db0d8e4fb2674efab398cbd0a9199f819 /math/k_casinhl.c
parentc4e33b8d8ba03ecb094904fb8c07c0858496b586 (diff)
downloadglibc-8cf28c5ebe7b02e769a3f3082fd390e6d8c11542.zip
glibc-8cf28c5ebe7b02e769a3f3082fd390e6d8c11542.tar.gz
glibc-8cf28c5ebe7b02e769a3f3082fd390e6d8c11542.tar.bz2
Fix casinh spurious underflows away from [-i,i] (bug 15062).
Diffstat (limited to 'math/k_casinhl.c')
-rw-r--r--math/k_casinhl.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/math/k_casinhl.c b/math/k_casinhl.c
index 6412979..110ae33 100644
--- a/math/k_casinhl.c
+++ b/math/k_casinhl.c
@@ -64,6 +64,26 @@ __kernel_casinhl (__complex__ long double x, int adj)
res = __clogl (y);
__real__ res += M_LN2l;
}
+ else if (rx >= 0.5L && ix < LDBL_EPSILON / 8.0L)
+ {
+ long double s = __ieee754_hypotl (1.0L, rx);
+
+ __real__ res = __ieee754_logl (rx + s);
+ if (adj)
+ __imag__ res = __ieee754_atan2l (s, __imag__ x);
+ else
+ __imag__ res = __ieee754_atan2l (ix, s);
+ }
+ else if (rx < LDBL_EPSILON / 8.0L && ix >= 1.5L)
+ {
+ long double s = __ieee754_sqrtl ((ix + 1.0L) * (ix - 1.0L));
+
+ __real__ res = __ieee754_logl (ix + s);
+ if (adj)
+ __imag__ res = __ieee754_atan2l (rx, __copysignl (s, __imag__ x));
+ else
+ __imag__ res = __ieee754_atan2l (s, rx);
+ }
else
{
__real__ y = (rx - ix) * (rx + ix) + 1.0;