[Piglit] [PATCH 2/2] cl: Fix erfc test

Jan Vesely jano.vesely at gmail.com
Sun Oct 22 16:20:00 UTC 2017


python:
>>> math.erfc(1.960/math.sqrt(2.0)).hex()
'0x1.9990c58859300p-5'
float rtne rounds up to 0x1.9990c6p-5

>>> math.erfc(2.576/math.sqrt(2.0)).hex()
'0x1.4784addb5643fp-7'
float rtne rounds up to 0x1.4784aep-7

Signed-off-by: Jan Vesely <jano.vesely at gmail.com>
---
 generated_tests/gen_cl_math_builtins.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generated_tests/gen_cl_math_builtins.py b/generated_tests/gen_cl_math_builtins.py
index 38d36a302..47a1a1eb5 100644
--- a/generated_tests/gen_cl_math_builtins.py
+++ b/generated_tests/gen_cl_math_builtins.py
@@ -285,7 +285,7 @@ tests = {
         'arg_types' : [F, F],
         'function_type': 'ttt',
         'values' : [
-            [1.0, 0.95, 0.009995, 1.994999, 0.0, 0.0, 2.0], # Result
+            [1.0, float.fromhex('0x1.9990c6p-5'), float.fromhex('0x1.4784aep-7'), 1.994999, 0.0, 0.0, 2.0], # Result
             [0.0, 1.960/sqrt(2.0), 2.576/sqrt(2.0), -2.807/sqrt(2.0), 11.1, float("inf"), float("-inf")]  # Arg0
         ],
         'tolerance' : 16
-- 
2.13.6



More information about the Piglit mailing list