+2016-03-10 Joseph Myers <joseph@codesourcery.com>
+
+ * manual/math.texi (Errors in Math Functions): Document relaxed
+ accuracy goals for IBM long double.
+ * math/libm-test.inc (test_exceptions): Always allow spurious
+ "underflow" and "inexact" exceptions for IBM long double.
+
2016-03-10 H.J. Lu <hongjiu.lu@intel.com>
[BZ #19762]
necessarily the exact value actually passed with discontiguous
mantissa bits.
+@item
+For the IBM @code{long double} format, functions whose results are
+fully specified by reference to corresponding IEEE 754 floating-point
+operations have the same accuracy goals as other functions, but with
+the error bound being the same as that for division (3ulp).
+Furthermore, ``inexact'' and ``underflow'' exceptions may be raised
+for all functions for any inputs, even where such exceptions are
+inconsistent with the returned value, since the underlying
+floating-point arithmetic has that property.
+
@item
Functions behave as if the infinite-precision result computed is zero,
infinity or NaN if and only if that is the mathematically correct
test_single_exception (test_name, exception, OVERFLOW_EXCEPTION,
FE_OVERFLOW, "Overflow");
#endif
+ /* Spurious "underflow" and "inexact" exceptions are always
+ allowed for IBM long double, in line with the underlying
+ arithmetic. */
#ifdef FE_UNDERFLOW
- if ((exception & UNDERFLOW_EXCEPTION_OK) == 0)
+ if ((exception & UNDERFLOW_EXCEPTION_OK) == 0
+ && !(TEST_COND_ldbl_128ibm
+ && (exception & UNDERFLOW_EXCEPTION) == 0))
test_single_exception (test_name, exception, UNDERFLOW_EXCEPTION,
FE_UNDERFLOW, "Underflow");
#endif
#ifdef FE_INEXACT
- if ((exception & (INEXACT_EXCEPTION | NO_INEXACT_EXCEPTION)) != 0)
+ if ((exception & (INEXACT_EXCEPTION | NO_INEXACT_EXCEPTION)) != 0
+ && !(TEST_COND_ldbl_128ibm
+ && (exception & NO_INEXACT_EXCEPTION) != 0))
test_single_exception (test_name, exception, INEXACT_EXCEPTION,
FE_INEXACT, "Inexact");
#endif