diff options
Diffstat (limited to 'math/s_clogl.c')
-rw-r--r-- | math/s_clogl.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/math/s_clogl.c b/math/s_clogl.c index aebff2adc2..6db59b722f 100644 --- a/math/s_clogl.c +++ b/math/s_clogl.c @@ -1,5 +1,5 @@ /* Compute complex natural logarithm. - Copyright (C) 1997-2015 Free Software Foundation, Inc. + Copyright (C) 1997-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -72,15 +72,8 @@ __clogl (__complex__ long double x) if (absx == 1.0L && scale == 0) { - long double absy2 = absy * absy; - if (absy2 <= LDBL_MIN * 2.0L) - { - long double force_underflow = absy2 * absy2; - __real__ result = absy2 / 2.0L; - math_force_eval (force_underflow); - } - else - __real__ result = __log1pl (absy2) / 2.0L; + __real__ result = __log1pl (absy * absy) / 2.0L; + math_check_force_underflow_nonneg (__real__ result); } else if (absx > 1.0L && absx < 2.0L && absy < 1.0L && scale == 0) { @@ -90,14 +83,17 @@ __clogl (__complex__ long double x) __real__ result = __log1pl (d2m1) / 2.0L; } else if (absx < 1.0L - && absx >= 0.75L + && absx >= 0.5L && absy < LDBL_EPSILON / 2.0L && scale == 0) { long double d2m1 = (absx - 1.0L) * (absx + 1.0L); __real__ result = __log1pl (d2m1) / 2.0L; } - else if (absx < 1.0L && (absx >= 0.75L || absy >= 0.5L) && scale == 0) + else if (absx < 1.0L + && absx >= 0.5L + && scale == 0 + && absx * absx + absy * absy >= 0.5L) { long double d2m1 = __x2y2m1l (absx, absy); __real__ result = __log1pl (d2m1) / 2.0L; |