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: Andreas Gustafsson <gson%gson.org@localhost>
To: Rin Okuyama <okuyama%flex.phys.tohoku.ac.jp@localhost>
Cc: gnats-bugs%NetBSD.org@localhost
Subject: Re: lib/50698: hypotf() of small numbers yields infinity
Date: Fri, 11 Mar 2016 17:14:15 +0200
On Feb 1, Rin Okuyama wrote:
> 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.
Likewise :)
> 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:
>
> https://svnweb.freebsd.org/base/head/lib/msun/tests/
>
> Function returns for some special arguments are checked in their test.
> But is it enough? Who can check hundreds of magic numbers?
These are all good questions, but I'm afraid I don't have the answers.
In any case, the specific bug reported in this PR has now been fixed
and pulled up to -7, so I will close the PR. If you have suggestions
for additional tests or fixes, either for hypotf() or for libm in
general, feel free to submit them as separate PRs.
--
Andreas Gustafsson, gson%gson.org@localhost
Home |
Main Index |
Thread Index |
Old Index