From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12701 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: catan errors Date: Wed, 11 Apr 2018 01:08:50 +0200 Message-ID: <20180410230849.GK4418@port70.net> References: <20180410195007.GI3094@brightrain.aerifal.cx> 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 1523401634 26911 195.159.176.226 (10 Apr 2018 23:07:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 10 Apr 2018 23:07:14 +0000 (UTC) User-Agent: Mutt/1.9.1 (2017-09-22) To: musl@lists.openwall.com Original-X-From: musl-return-12717-gllmg-musl=m.gmane.org@lists.openwall.com Wed Apr 11 01:07:10 2018 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 1f62Lu-0006b3-8I for gllmg-musl@m.gmane.org; Wed, 11 Apr 2018 01:07:02 +0200 Original-Received: (qmail 7255 invoked by uid 550); 10 Apr 2018 23:09:02 -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 7230 invoked from network); 10 Apr 2018 23:09:01 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20180410195007.GI3094@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:12701 Archived-At: * Rich Felker [2018-04-10 15:50:07 -0400]: > > 3. Is only possible if y==1.0 and x==0.0, which is the only real > exceptional case for atan: z==I. > > I opted to replace the non-obvious (3) with an explicit check for z==I > but this isn't necessary. > ... > t = y - 1.0; > a = x2 + (t * t); > - if (a == 0.0) > - goto ovrf; why does a==0 imply x==0? if |x| < sqrt(2)*0x1p-538, x2 underflows to 0 in nearest rounding mode. to handle this correctly extra work would need to be done, so i think either way is fine (leaving the goto there or not are both wrong, but we dont guarantee correct complex functions yet)