From owner-freebsd-current@freebsd.org Sat Feb 6 22:13:54 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC5E453C4F0 for ; Sat, 6 Feb 2021 22:13:54 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DY64y4Vq6z4lc5; Sat, 6 Feb 2021 22:13:54 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 116MDr7g046396 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 6 Feb 2021 14:13:53 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 116MDrrP046395; Sat, 6 Feb 2021 14:13:53 -0800 (PST) (envelope-from sgk) Date: Sat, 6 Feb 2021 14:13:53 -0800 From: Steve Kargl To: Dimitry Andric Cc: FreeBSD Current Subject: Re: hypothl(x) mishandles subnormal numbers. Message-ID: <20210206221353.GB46087@troutmask.apl.washington.edu> References: <20210206203929.GA45801@troutmask.apl.washington.edu> <20210206210448.GC45801@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4DY64y4Vq6z4lc5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Feb 2021 22:13:54 -0000 On Sat, Feb 06, 2021 at 10:32:33PM +0100, Dimitry Andric wrote: > On 6 Feb 2021, at 22:04, Steve Kargl wrote: > > > > On Sat, Feb 06, 2021 at 12:39:29PM -0800, Steve Kargl wrote: > >> I've long forgotten by freebsd bugzilla password. > >> So, if someone would like to submit a bug report, > >> here's a test program. > >> > > Forgot to include that issue was identified from > > a bug report in the OpenLibm bug mailing list. > > > > https://github.com/JuliaMath/openlibm/issues/224 > > I put this in . Now the trick is to > figure out what is going on in e_hypotl.c... :) > Thanks. I took a quick look, and there seems to be some magic scaling happen. hypotl(x,y) should compute sqrtl(x*x+y*y) while avoiding overflows and underflows. I suspect that the scaling needs to be tweaked. It may take me a bit to work out how to fix it. -- Steve