sleef
sleef copied to clipboard
intermediate denormal numbers?
I guess denormals can appear in intermediate variables. But not all architectures support denormal, or denormal can be disabled by user with FTZ flag. Have we reviewed precision for such cases?
Denormals should be treated correctly. Please check the source code for tester2*.c. A few functions cannot handle denormals very well. For those functions, the error range is specified as max(DBL_MIN, xxULPs).
Just to clarify: even if input x
is not a denormal number, for example, I guess the following two functions can result different outputs, because denormal numbers can appear during computation.
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
// x is not necessarily denormal
xsinf(x);
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_OFF);
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_OFF);
// x is not necessarily denormal
xsinf(x);
Perhaps supporting FTZ/DAZ flags == ON is out of the scope, but to my understanding some architectures don't support denormals at all (ARM Neon?). Likely it's not a big issue but I think it's good to review that if there is some difference between FTZ/DAZ on & off.
Although it is not mentioned, SLEEF implicitly assumes IEEE 754 compliance. For AARCH32, flush to zero mode is supported in an ad-hoc way.