cexpl() (was: Re: Update ENTERI() macro)

Steve Kargl sgk at troutmask.apl.washington.edu
Fri Mar 8 21:48:03 UTC 2019


(reducing quote depth.  I'll need time to digest your bit analysis)

On Sat, Mar 09, 2019 at 07:53:24AM +1100, Bruce Evans wrote:
> On Fri, 8 Mar 2019, Steve Kargl wrote:
> 
> > This then raises the question on whether we should change the
> > limit to 32 in the double complex ccosh()?
> 
> Do you mean from 64 to 32 the non-complex cosh(), or from your current
> limit to the above?
> 

I mean ccosh(double complex).  Copyright date is 2005 for
s_ccosh.c while ld80/*_expl.* has datesi of 2009-2013.  It
seems you and I developed s_ccosh.c much earlier than the
Tang-based expl().  In s_ccosh.c, we have

	if (ix < 0x40360000) /* |x| < 22: normal case */
	    return (CMPLX(cosh(x) * cos(y), sinh(x) * sin(y)));

	/* |x| >= 22, so cosh(x) ~= exp(|x|) */
	if (ix < 0x40862e42) {
		/* x < 710: exp(|x|) won't overflow */
		h = exp(fabs(x)) * 0.5;
		return (CMPLX(h * cos(y), copysign(h, x) * sin(y)));
	} ...

Would it be beneficial to change |x| < 22 to |x| < 32?  

While we have kernels for exp(), I did not commit your
Tang-based exp(). So, exp() has ulp of 0.7 to 0.8 instead
of 0.5xx.  Maybe using 32 won't buy us anything.  

-- 
Steve


More information about the freebsd-numerics mailing list