Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Mar 2019 13:47:50 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        freebsd-numerics@freebsd.org
Subject:   Re: cexpl() (was: Re: Update ENTERI() macro)
Message-ID:  <20190308214750.GA34090@troutmask.apl.washington.edu>
In-Reply-To: <20190309070413.G2539@besplex.bde.org>
References:  <20190306214233.GA23159@troutmask.apl.washington.edu> <20190307144315.N932@besplex.bde.org> <20190307044447.GA16298@troutmask.apl.washington.edu> <20190307163958.V1293@besplex.bde.org> <20190307195436.GA20856@troutmask.apl.washington.edu> <20190308225807.D6410@besplex.bde.org> <20190308162432.GA31392@troutmask.apl.washington.edu> <20190309033820.J1443@besplex.bde.org> <20190308191150.GA32980@troutmask.apl.washington.edu> <20190309070413.G2539@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
(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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190308214750.GA34090>