From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/661 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: correctly rounded sqrt Date: Thu, 15 Mar 2012 19:22:41 +0100 Message-ID: <20120315182240.GM5728@port70.net> References: <20120314165604.GF5728@port70.net> <20120314190123.GH5728@port70.net> <20120315014647.GI5728@port70.net> <20120315032304.GJ5728@port70.net> <20120315050748.GC184@brightrain.aerifal.cx> <20120315053011.GK5728@port70.net> <20120315080244.GL5728@port70.net> <20120315161223.GD184@brightrain.aerifal.cx> <9048289A-E316-4F75-96C3-60502B2E563D@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1331835774 17521 80.91.229.3 (15 Mar 2012 18:22:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2012 18:22:54 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-662-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 15 19:22:53 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1S8FK9-0006Co-Cf for gllmg-musl@plane.gmane.org; Thu, 15 Mar 2012 19:22:53 +0100 Original-Received: (qmail 12273 invoked by uid 550); 15 Mar 2012 18:22:52 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 12265 invoked from network); 15 Mar 2012 18:22:52 -0000 Content-Disposition: inline In-Reply-To: <9048289A-E316-4F75-96C3-60502B2E563D@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:661 Archived-At: * Pascal Cuoq [2012-03-15 19:14:09 +0100]: > >> if (signexp >= 0x7fff) is probably a better check > > > > Haha, this is the second time I stupidly forget sqrt(x) is > > nonnegative... :-) Fixing it.. > > I apologize if this is not relevant ???I admit I followed the discussion with only half my attention??? but note that sqrt(-0.) is -0., so the sign bit may be set in both argument and result of sqrt(). yes, that's handled correctly we were talking only about the 'hard to round case' (long double square root significand ends in ..xxx10000000000) dalias: meanwhile i realized that a double nan cannot end in 0x400 when converted to long double so i was wrong about the nan check, it's not needed sorry (maybe it makes sense to add a small comment to that sqrt.s because it's not trivial for newcommers)