Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 2017 11:09:27 -0700
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        freebsd-numerics@freebsd.org
Subject:   Re: Implementation of half-cycle trignometric functions
Message-ID:  <20170517180927.GA54431@troutmask.apl.washington.edu>
In-Reply-To: <20170517094848.A52247@besplex.bde.org>
References:  <20170409220809.GA25076@troutmask.apl.washington.edu> <20170427231411.GA11346@troutmask.apl.washington.edu> <20170428175851.A1386@besplex.bde.org> <20170516224618.GA40855@troutmask.apl.washington.edu> <20170517094848.A52247@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 17, 2017 at 12:49:45PM +1000, Bruce Evans wrote:
> On Tue, 16 May 2017, Steve Kargl wrote:
> 
> > Index: lib/msun/ld128/s_cospil.c
> > ...
> > +static const long double
> > +pihi = 3.14159265358979322702026593105983920e+00L,
> > +pilo = 1.14423774522196636802434264184180742e-17L;
> 
> These are not in normal format, and are hard to read.  I can't see if
> pihi has the correct number of zero bits for exact multiplication.

I don't have access to an ld128 system with suitable 
facilities to allow me to spit out the hex representation.
As such, I've added a comment

/*
 * pi_hi contains the leading 56 bits of a 169 bit approximation for pi.
 */

> 
> These don't have the normal spelling.  fdlibm never uses pihi or pio2hi,
> or pi_hi.  It often uses pio2_hi and other pio2_*.  My s_sinpi.c uses
> pi_hi.

fdlibm has no convention.  For example, e_log10.c actually uses
a mixature of convensions.

static const double
two54      =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
ivln10hi   =  4.34294481878168880939e-01, /* 0x3fdbcb7b, 0x15200000 */
ivln10lo   =  2.50829467116452752298e-11, /* 0x3dbb9438, 0xca9aadd5 */
log10_2hi  =  3.01029995663611771306e-01, /* 0x3FD34413, 0x509F6000 */
log10_2lo  =  3.69423907715893078616e-13; /* 0x3D59FEF3, 0x11F12B36 */

and 

        double f,hfsq,hi,lo,r,val_hi,val_lo,w,y,y2;

-- 
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?20170517180927.GA54431>