From owner-freebsd-numerics@FreeBSD.ORG Sun Aug 12 23:13:50 2012 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC036106566B for ; Sun, 12 Aug 2012 23:13:49 +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 73E998FC18 for ; Sun, 12 Aug 2012 23:13:49 +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 q7CNDnBq075978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 09:13:49 +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 q7CNDgvf021948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 13 Aug 2012 09:13:43 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q7CNDgaj021947 for freebsd-numerics@freebsd.org; Mon, 13 Aug 2012 09:13:42 +1000 (EST) (envelope-from peter) Resent-From: Peter Jeremy Resent-Date: Mon, 13 Aug 2012 09:13:42 +1000 Resent-Message-ID: <20120812231342.GE20453@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 q6J8bwC1038774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Jul 2012 18:38:00 +1000 (EST) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q6J8bwXU079933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 19 Jul 2012 18:37:58 +1000 (EST) (envelope-from brde@optusnet.com.au) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6J8baEr025385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 19 Jul 2012 18:37:37 +1000 From: Bruce Evans Mail-Followup-To: freebsd-numerics@freebsd.org X-X-Sender: bde@besplex.bde.org To: Bruce Evans In-Reply-To: <20120719144432.N1596@besplex.bde.org> Message-ID: <20120719182849.T2190@besplex.bde.org> References: <20120529045612.GB4445@server.rulingia.com> <20120711223247.GA9964@troutmask.apl.washington.edu> <20120713114100.GB83006@server.rulingia.com> <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> <20120717200931.U6624@besplex.bde.org> <5006D13D.2080702@missouri.edu> <20120719144432.N1596@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Sun, 12 Aug 2012 23:56:00 +0000 Cc: Diane Bruce , John Baldwin , David Chisnall , Stephen Montgomery-Smith , Bruce Evans , Steve Kargl , David Schultz , Peter Jeremy , 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 23:13:50 -0000 X-Original-Date: Thu, 19 Jul 2012 18:37:36 +1000 (EST) X-List-Received-Date: Sun, 12 Aug 2012 23:13:50 -0000 On Thu, 19 Jul 2012, Bruce Evans wrote: > On Wed, 18 Jul 2012, Stephen Montgomery-Smith wrote: > >> I went on a long road trip yesterday, so I didn't get any code written, but >> I did have a lot of thoughts about clog and casinh. >> >> First, the naive formula (here z=x+I*y) >> clog(z) = cpack(log(hypot(x,y)),atan2(x,y)) >> is going to work in a lot more edge cases then one might expect. This is >> because hypot and atan2, especially atan2, already do a rather good job >> getting the edge cases right. I am thinking in particular of when x or y >> are 0 or -0, or one of them is infinity or -infinity. > > Right, clog is deceptively simple. This is because it decomposes perfectly > into 2 real functions of 2 real variables and both of these functions are > standard and already implemented almost as well as possible. ISTR das > saying that it had a complicated case, but I don't see even one. atan2() Duh, I forget that log() must be applied to hypot(). You found the surprisingly large inaccuracies from (too-?) simple avoidance of overflow in hypot() soon after I first replied. Is there a problem even without overflow? I think log contracts any errors in hypot() so there isn't, but then why doesn't it contract any error in the overflow avoidance? Bruce