This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Relax gen-auto-libm-tests may-underflow rules, test log1p in all rounding modes
- From: Andreas Jaeger <aj at suse dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Date: Tue, 25 Mar 2014 13:22:50 +0100
- Subject: Re: Relax gen-auto-libm-tests may-underflow rules, test log1p in all rounding modes
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1403241609520 dot 6513 at digraph dot polyomino dot org dot uk>
On 03/24/2014 05:10 PM, Joseph S. Myers wrote:
> gen-auto-libm-tests presently allows but does not require underflow
> exceptions for results with magnitude in the range (greatest
> subnormal, least normal].
>
> In some cases, the magnitude of the exact result is very slightly
> above the least normal, but rounding in the implementation results in
> it effectively computing an infinite-precision result that is slightly
> below the least normal, so raising an underflow exception. This is in
> accordance with the documented accuracy goals, but results in
> testsuite failures.
>
> This patch changes the logic to allow underflows when the mathematical
> result is up to 0.5ulp above the least normal (so in any case where
> the round-to-nearest result is the least normal). Ideally underflows
> in all these cases would be accepted only when an underflow with the
> actual result is consistent with the rounding mode (in FE_TOWARDZERO
> mode, a return value of the least normal implies that the
> infinite-precision result did not underflow so there should be no
> underflow exception, for example), so as to match the documented goals
> more precisely - whereas at present the tests for exceptions are
> completely independent of the tests of the returned values. (The same
> applies to overflow exceptions as well - they too should be checked
> for consistency with the result, as in FE_TOWARDZERO mode a result
> 1ulp below the largest finite value should be inconsistent with an
> overflow exception and cause a failure with overflow rather than
> simply being considered a 1ulp error when overflow is expected.) But
> the present patch at least deals with the cases causing spurious
> failures so that (a) certain existing tests no longer need to be
> marked as having spurious exceptions (such markings in
> auto-libm-test-in end up applying to more cases than just those they
> are needed for) and (b) log1p can be tested in all rounding modes
> without introducing more such failures. This patch duly moves tests
> of log1p to ALL_RM_TEST.
>
> Tested x86_64 and x86 and ulps updated accordingly.
Thanks!
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126