Update SIMD math tests and improve accuracy
commit55522e38fd8423d6f486eca4dd6587c4b74e4dc0
authorErik Lindahl <erik@kth.se>
Sun, 1 Sep 2019 12:28:36 +0000 (1 14:28 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 12 Sep 2019 00:27:36 +0000 (12 02:27 +0200)
treea1a016aeb8ad61086329320199d05f3818c691a4
parentc4359ca5dcb93e8381dfc4537c517a43271f8048
Update SIMD math tests and improve accuracy

Improve the SIMD math function test by selecting
points to be equidistant in IEEE754 bit-space, and
specify test ranges by explcitly constructing the
threshold points used to select ranges.

This significantly extends the ranges over which
some functions are tested, and could lead to some
failed tests that were previously hidden, although they
are likely benign. With these tests, errors were found
in a few of the double-precision functions where 1/x
was evaluated for intermediate values smaller than the
lowest-magnitude single precision number, which have
now been fixed with additional masking.

Second, a fragile construct when evaluating exp() in
single precision without FMA support has been replaced
to improve precision when very small intermediate values
were flushed to zero by the intel compiler, in particular
icc19.

Change-Id: I3e4b1e5799f748b02f592398df762e1e318887e6
src/gromacs/simd/simd_math.h
src/gromacs/simd/tests/base.h
src/gromacs/simd/tests/refdata/SimdMathTest_generateTestPointsDouble.xml [new file with mode: 0644]
src/gromacs/simd/tests/refdata/SimdMathTest_generateTestPointsFloat.xml [new file with mode: 0644]
src/gromacs/simd/tests/simd4_math.cpp
src/gromacs/simd/tests/simd_math.cpp