hypothl(x) mishandles subnormal numbers.

Steve Kargl sgk at troutmask.apl.washington.edu
Sat Feb 6 22:13:54 UTC 2021


On Sat, Feb 06, 2021 at 10:32:33PM +0100, Dimitry Andric wrote:
> On 6 Feb 2021, at 22:04, Steve Kargl <sgk at troutmask.apl.washington.edu> 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 <https://bugs.freebsd.org/253313>. 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


More information about the freebsd-current mailing list