From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/652 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 04:23:04 +0100 Message-ID: <20120315032304.GJ5728@port70.net> References: <20120314165604.GF5728@port70.net> <20120314190123.GH5728@port70.net> <20120315014647.GI5728@port70.net> 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 1331781799 4508 80.91.229.3 (15 Mar 2012 03:23:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2012 03:23:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-653-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 15 04:23:18 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 1S81HY-0001Qx-9R for gllmg-musl@plane.gmane.org; Thu, 15 Mar 2012 04:23:16 +0100 Original-Received: (qmail 9709 invoked by uid 550); 15 Mar 2012 03:23:15 -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 9701 invoked from network); 15 Mar 2012 03:23:15 -0000 Content-Disposition: inline In-Reply-To: <20120315014647.GI5728@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:652 Archived-At: * Szabolcs Nagy [2012-03-15 02:46:48 +0100]: > /* dekker exact mult u*u == hi + lo */ > static void sq(long double *hi, long double *lo, long double u) > { > static const long double c = 1.0 + 0x1p33; this was wrong, c = 1.0 + 0x1p32; the correct value and probably *hi = u1*u1; *lo = u1*u2*2.0 + u2*u2; is enough instead of > *hi = u*u; > *lo = (u1*u1 - *hi) + u1*u2*2.0 + u2*u2; but now that we figured out the fpu status register based solution this does not matter..