1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
From: Paul Zander <negril.nx+gentoo@gmail.com>
Make simd tests use a threshold for floating point equality check
diff --git a/src/libutil/simd_test.cpp b/src/libutil/simd_test.cpp
index 4ecee70..0c15d81 100644
--- a/src/libutil/simd_test.cpp
+++ b/src/libutil/simd_test.cpp
@@ -1611,8 +1611,8 @@ void test_mathfuncs ()
VEC expA = mkvec<VEC> (0.367879441171442f, 1.0f, 2.718281828459045f, 90.0171313005218f);
OIIO_CHECK_SIMD_EQUAL (exp(A), expA);
OIIO_CHECK_SIMD_EQUAL_THRESH (log(expA), A, 1e-6f);
- OIIO_CHECK_SIMD_EQUAL (fast_exp(A),
- mkvec<VEC>(fast_exp(A[0]), fast_exp(A[1]), fast_exp(A[2]), fast_exp(A[3])));
+ OIIO_CHECK_SIMD_EQUAL_THRESH (fast_exp(A),
+ mkvec<VEC>(fast_exp(A[0]), fast_exp(A[1]), fast_exp(A[2]), fast_exp(A[3])), 1e-7f);
OIIO_CHECK_SIMD_EQUAL_THRESH (fast_log(expA),
mkvec<VEC>(fast_log(expA[0]), fast_log(expA[1]), fast_log(expA[2]), fast_log(expA[3])), 0.00001f);
OIIO_CHECK_SIMD_EQUAL_THRESH (fast_pow_pos(VEC(2.0f), A),
|