Date: Thu, 27 Apr 2017 16:14:11 -0700 From: Steve Kargl <sgk@troutmask.apl.washington.edu> To: freebsd-numerics@freebsd.org Cc: freebsd-hackers@freebsd.org Subject: Re: Implementation of half-cycle trignometric functions Message-ID: <20170427231411.GA11346@troutmask.apl.washington.edu> In-Reply-To: <20170409220809.GA25076@troutmask.apl.washington.edu> References: <20170409220809.GA25076@troutmask.apl.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Apr 09, 2017 at 03:08:09PM -0700, Steve Kargl wrote: > Both IEEE-754 2008 and ISO/IEC TS 18661-4 define the half-cycle > trignometric functions cospi, sinpi, and tanpi. The attached > patch implements cospi[fl], sinpi[fl], and tanpi[fl]. Limited > testing on the cospi and sinpi reveal a max ULP less than 0.89; > while tanpi is more problematic with a max ULP less than 2.01 > in the interval [0,0.5]. The algorithms used in these functions > are documented in {ks}_cospi.c, {ks}_sinpi.c, and s_tanpi.c. > > Note 1. ISO/IEC TS 18661-4 says these funstions are guarded by > a predefine macro. I have no idea or interest in what clang and > gcc do with regards to this macro. I've put the functions behind > __BSD_VISIBLE. > > Note 2. I no longer have access to a system with ld128 and > adequate support to compile and test the ld128 implementations > of these functions. Given the almost complete lack of input from > others on improvements to libm, I doubt that anyone cares. If > someone does care, the ld128 files contain a number of FIXME comments, > and in particular, while the polynomial coefficients are given > I did not update the polynomial algorithms to properly use the > coefficients. > > The code is attached the bug reportr. > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218514 > I have attached a new diff to the bugzilla report. The diff is 3090 lines and won't be broadcast the mailing list. This diff includes fixes for a few inconsequential bugs and implements modified Estrin's method for sum a few ploynomials. If you want the previous Horner's method then add -DHORNER to your CFLAGS. -- Steve 20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4 20161221 https://www.youtube.com/watch?v=IbCHE-hONow
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170427231411.GA11346>