From owner-freebsd-standards@FreeBSD.ORG Mon Dec 10 07:17:20 2007 Return-Path: Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4945C16A468 for ; Mon, 10 Dec 2007 07:17:20 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.freebsd.org (Postfix) with ESMTP id 0957A13C4E1 for ; Mon, 10 Dec 2007 07:17:19 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.14.2/8.14.1) with ESMTP id lBA7GoaX012987; Mon, 10 Dec 2007 02:16:50 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.14.2/8.14.1/Submit) id lBA7GoHT012986; Mon, 10 Dec 2007 02:16:50 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Mon, 10 Dec 2007 02:16:50 -0500 From: David Schultz To: Bruce Evans Message-ID: <20071210071650.GA12886@VARK.MIT.EDU> Mail-Followup-To: Bruce Evans , Steve Kargl , freebsd-standards@FreeBSD.ORG References: <20071103001305.GA82775@troutmask.apl.washington.edu> <20071209212505.GA9698@VARK.MIT.EDU> <20071209213450.GA95726@troutmask.apl.washington.edu> <20071209223918.GA9920@VARK.MIT.EDU> <20071210153413.W3836@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071210153413.W3836@delplex.bde.org> Cc: freebsd-standards@FreeBSD.ORG, Steve Kargl Subject: Re: Implementation of expl() X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2007 07:17:20 -0000 On Mon, Dec 10, 2007, Bruce Evans wrote: > On Sun, 9 Dec 2007, David Schultz wrote: > > >Some minor fixes (mostly whitespace) are below. > > > >Also, don't you lose precision when you do stuff like this? > > z.e = 1 / z.e; > > > >In any case, if you can get me the appropriate constants for the > >128-bit format, I'll clean everything up and check it in, which > >will make a lot of ports maintainers happy. That will pave the way > >to other stuff (e.g., MD versions of this) as well. We can worry > >about subnormals later. > > Why not convert the fdlibm algorithm for exp() as is done for expf()? > It is much better (*), doesn't need to be debugged (except for the > conversion), and would be easier to maintain. > > Better algorithms exist, like someone named das@ used for exp2(), but > would be harder to debug and maintain. I'm not worried about maintenance, since I don't expect God to add any major new features to e^x any time soon. Writing exp2() took a lot of reading papers and tinkering, and it's a pain in the neck to generate the constants and figure out the resulting error for each interval. I seem to recall trying the same tricks for expl(), but there were problems with rescaling in base e instead of base 2 without losing accuracy. In any case, I don't have the kind of time needed to fix all of that stuff now. I don't really care how expl() is implemented; anything that works is better than anything that doesn't. If someone comes up with a better, cleverer scheme later, that's great, but we've been talking about a lot of this stuff forever and there's still nothing in the tree.