From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 12 22:56:06 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C52AB1065673 for ; Sun, 12 Aug 2012 22:56:06 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id 5D8A18FC0A for ; Sun, 12 Aug 2012 22:56:05 +0000 (UTC) Received: from server.rulingia.com (c220-239-249-137.belrs5.nsw.optusnet.com.au [220.239.249.137]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q7CMu518075488 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 08:56:05 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q7CMtx2J020844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 13 Aug 2012 08:55:59 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q7CMtx2Z020843 for freebsd-numerics@freebsd.org; Mon, 13 Aug 2012 08:55:59 +1000 (EST) (envelope-from peter) Resent-From: Peter Jeremy Resent-Date: Mon, 13 Aug 2012 08:55:59 +1000 Resent-Message-ID: <20120812225559.GF20453@server.rulingia.com> Resent-To: freebsd-numerics@freebsd.org Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q6H4crIo070263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 17 Jul 2012 14:38:54 +1000 (EST) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q6H4cos0065948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 17 Jul 2012 14:38:52 +1000 (EST) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id q6H4cm3s087072; Mon, 16 Jul 2012 21:38:48 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id q6H4cmYs087071; Mon, 16 Jul 2012 21:38:48 -0700 (PDT) (envelope-from sgk) From: Steve Kargl Mail-Followup-To: freebsd-numerics@freebsd.org To: Peter Jeremy Message-ID: <20120717043848.GB87001@troutmask.apl.washington.edu> References: <201207130818.38535.jhb@freebsd.org> <9EB2DA4F-19D7-4BA5-8811-D9451CB1D907@theravensnest.org> <20120713155805.GC81965@zim.MIT.EDU> <20120714120432.GA70706@server.rulingia.com> <20120717084457.U3890@besplex.bde.org> <5004A5C7.1040405@missouri.edu> <5004DEA9.1050001@missouri.edu> <20120717040118.GA86840@troutmask.apl.washington.edu> <20120717042125.GF66913@server.rulingia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120717042125.GF66913@server.rulingia.com> User-Agent: Mutt/1.4.2.3i Cc: Diane Bruce , John Baldwin , David Chisnall , Stephen Montgomery-Smith , Bruce Evans , Bruce Evans , David Schultz , Warner Losh Subject: Re: Use of C99 extra long double math functions after r236148 X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 12 Aug 2012 22:56:06 -0000 X-Original-Date: Mon, 16 Jul 2012 21:38:48 -0700 X-List-Received-Date: Sun, 12 Aug 2012 22:56:06 -0000 On Tue, Jul 17, 2012 at 02:21:25PM +1000, Peter Jeremy wrote: > On 2012-Jul-16 21:01:18 -0700, Steve Kargl wrote: > >On Mon, Jul 16, 2012 at 10:40:25PM -0500, Stephen Montgomery-Smith wrote: > >> > >> I came up with pseudo code that looks a bit like this. > ... > >Stop. Please see msun/src/math_private.h. You cannot > >use I in any expression. > > Note the "pseudo code" reference. I agree that the actual code has to > jump through hoops to avoid compiler issues with complex arithmetic > but doing that for pseudocode just obfuscates it. > > >Also, consult n1256.pdf for x,y = +-0, +-inf, nan. > >There are specific requirements that must be met. > > Again, handling the special cases listed in G.6 is all just > boilerplate code that we can take as assumed for pseudocode. IMO, it > would be nice if we could come up with a formal, compact (one/line per > rule) representation of G.6 that could be pre-processed into wrapper > code that handles all the 0/Inf/NaN special-cases and then calls > FOO_finite() which has the hand-written code to handle "normal" cases. > As someone who spent 10+ years getting sqrtl(), cbrtl(), ccosh(), sinl(), cosl(), tanl(), etc into FreeBSD, I respectfully disagree with your take that it is just boilerplate. Getting this stuff right is much harder than I think some people understand. Oh well, I'll back to lurking and working on things I need. -- Steve