NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/50698: hypotf() of small numbers yields infinity

The following reply was made to PR lib/50698; it has been noted by GNATS.

From: Rin Okuyama <>
To: Andreas Gustafsson <>
Subject: Re: lib/50698: hypotf() of small numbers yields infinity
Date: Mon, 1 Feb 2016 22:01:38 +0900

 On 2016/01/26 0:01, Andreas Gustafsson wrote:
 >>   Other changes have been made for libm in FreeBSD. IMO, we should merge
 >>   reasonable ones.
 > Additional patches for the ones you think are reasonable are welcome.
 > More test cases would be good, too.
 Sorry for the late reply. I examined FreeBSD's libm, and found it much
 harder than I had imagined to merge their changes into ours.
 There are three kinds of differences: (1) trivial bug fixes as in this
 case, (2) long double functions missing in our libm, and (3) non-trivial
 changes to improve the accuracy or processing speed.
 We can readily merge (1) by patiently comparing the two implementations.
 For (2), we have not fully implemented long double functions. Instead,
 we have wrappers to double functions in src/lib/libm/src/ldbl_dummy.c.
 Needless to say, this is problematic for architectures with
 LDBL_MANT_DIG != DBL_MANT_DIG. They have long double functions both for
 LDBL_MANT_DIG == 64 (amd64, i386, ia64, and m68k), and 113 (aarch64,
 mips64, and sparc64). If we can merge it, we then have long double
 functions for all architectures except powerpc64 (LDBL_MANT_DIG == 106).
 However, for (2) and (3), there remains a big problem; how can we test
 them? Addition to ATF-based tests ported from us, they have their own
 test cases:
 Function returns for some special arguments are checked in their test.
 But is it enough? Who can check hundreds of magic numbers?

Home | Main Index | Thread Index | Old Index