From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11259 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] fix scalbn when result is in the subnormal range Date: Fri, 21 Apr 2017 17:37:49 -0400 Message-ID: <20170421213749.GH17319@brightrain.aerifal.cx> References: <20170403003813.GY2082@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1492810687 307 195.159.176.226 (21 Apr 2017 21:38:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Apr 2017 21:38:07 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11274-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 21 23:38:02 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1d1gFe-0008PD-1I for gllmg-musl@m.gmane.org; Fri, 21 Apr 2017 23:38:02 +0200 Original-Received: (qmail 14277 invoked by uid 550); 21 Apr 2017 21:38:05 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 14246 invoked from network); 21 Apr 2017 21:38:01 -0000 Content-Disposition: inline In-Reply-To: <20170403003813.GY2082@port70.net> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11259 Archived-At: On Mon, Apr 03, 2017 at 02:38:13AM +0200, Szabolcs Nagy wrote: > in nearest rounding mode scalbn could introduce double rounding error > when an intermediate value and the final result were both in the > subnormal range e.g. > > scalbn(0x1.7ffffffffffffp-1, -1073) > > returned 0x1p-1073 instead of 0x1p-1074, because the intermediate > computation got rounded to 0x1.8p-1023. > > with the fix an intermediate value can only be in the subnormal range > if the final result is 0 which is correct even after double rounding. > (there still can be two roundings so signals may be raised twice, but > that's only observable with trapping exceptions which is not supported.) OK, applying. Rich