This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Compute correct sign for ctanh (Inf + iy) (BZ #17118)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]