From owner-freebsd-numerics@freebsd.org Thu May 18 01:42:28 2017 Return-Path: Delivered-To: freebsd-numerics@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 150C3D712C0 for ; Thu, 18 May 2017 01:42:28 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D3F74198A for ; Thu, 18 May 2017 01:42:27 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id v4I1gQvg063967 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 May 2017 18:42:26 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id v4I1gQAl063966; Wed, 17 May 2017 18:42:26 -0700 (PDT) (envelope-from sgk) Date: Wed, 17 May 2017 18:42:26 -0700 From: Steve Kargl To: Bruce Evans Cc: freebsd-numerics@freebsd.org Subject: Re: Implementation of half-cycle trignometric functions Message-ID: <20170518014226.GA63819@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu 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> <20170517180927.GA54431@troutmask.apl.washington.edu> <20170518072636.E951@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170518072636.E951@besplex.bde.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2017 01:42:28 -0000 On Thu, May 18, 2017 at 09:25:58AM +1000, Bruce Evans wrote: > On Wed, 17 May 2017, Steve Kargl wrote: > > > 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. > > flame is still in the freebsd cluster, but is almost unusable because > its files are an old copy of actual home directories on freefall. Yes, I know flame is still available. I deleted all infrastructure I had on freefall over 2 years agos. Need at a minimum GMP and MPFR. > Utilities for printing hex and FP in good formats are remarkably rare. > pari/gp supports many special math types but can only input or output > ordinarly numbers in decimal. I use my library routines to print hex > and special FP formats for it. sh, printf(1) and awk(1) are limited > by native tyoes and have many other defects. I wrote my own utility with the catchy name hex. > > As such, I've added a comment > > > > /* > > * pi_hi contains the leading 56 bits of a 169 bit approximation for pi. > > */ > > Why 56? 53 + 56 = 109. This is ld128. static const long double pi_hi = 3.14159265358979322702026593105983920e+00L, pi_lo = 1.14423774522196636802434264184180742e-17L; pi_hi has 113/2 = 56 bits. pi_lo has 113 bit. 56 + 113 = 169 > > >> 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. I've changed my spelling. > > My improvements to lgamma()'s sin_pi*() are buggy. I forgot the original > target of avoiding inexact better: I'll need to wait until the weekend to study your improved sin_pi. -- Steve 20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4 20161221 https://www.youtube.com/watch?v=IbCHE-hONow