This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Compute correct sign for ctanh (Inf + iy) (BZ #17118)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 11 Aug 2014 15:59:44 +0000
- Subject: Re: [PATCH] Compute correct sign for ctanh (Inf + iy) (BZ #17118)
- Authentication-results: sourceware.org; auth=none
- References: <mvmbnrr6n56 dot fsf at hawking dot suse dot de>
On Mon, 11 Aug 2014, Andreas Schwab wrote:
> @@ -32,8 +32,15 @@ __ctanh (__complex__ double x)
> {
> if (__isinf_ns (__real__ x))
> {
> + int icls = fpclassify (__imag__ x);
> + double sin2ix;
> +
> + if (__glibc_likely (icls != FP_SUBNORMAL))
> + sin2ix = sin (2 * __imag__ x);
That looks like it will cause spurious overflows if 2 * __imag__ x
overflows (you can use sin * cos to get the right sign instead).
--
Joseph S. Myers
joseph@codesourcery.com