From 55140f477d30f7e021ea9863d7f1770bd27067ad Mon Sep 17 00:00:00 2001 From: Yi Sun Date: Thu, 20 Feb 2014 09:32:32 +0800 Subject: [PATCH] Remove some unreasonable input values for rootn In manual for function pow(), there's following description: "If x is a finite value less than 0, and y is a finite noninteger, a domain error occurs, and a NaN is returned." That means we can't calculate rootn in cpu like this pow(x,1.0/y) which is mentioned in OpenCL spec. E.g. when y=3 and x=-8, rootn should return -2. But when we calculate pow(x, 1.0/y), it will return a Nan. I didn't find multi-root math function in glibc. Signed-off-by: Yi Sun --- utests/utest_math_gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utests/utest_math_gen.py b/utests/utest_math_gen.py index 2c701d1..20ae3f1 100755 --- a/utests/utest_math_gen.py +++ b/utests/utest_math_gen.py @@ -417,8 +417,8 @@ static float powr(float x, int y){ rintUtests = func('rint','rint',[rint_input_type],rint_output_type,[rint_input_values],'0 * FLT_ULP') ##### floatn rootn(floatn x, intn y) - rootn_input_values1 = [FLT_MAX_POSI,FLT_MIN_NEGA,FLT_MIN_POSI,FLT_MAX_NEGA,80, -80, 3.14, -3.14, -0.5, 0.5, 1, -1, 0.0,6,-6,1500.24,-1500.24,2,3,4] - rootn_input_values2 = [-1,-2,-3,2,3,6,7,8,9,2,11,12,13,14,15,16,2,2,2,2] + rootn_input_values1 = [0.0, 0.0012, 0.5, 1, 3.14, 12345] + rootn_input_values2 = [-1, 1, -20, 20, -123, 456] rootn_input_type1 = ['float','float2','float4','float8','float16'] rootn_input_type2 = ['int','int2','int4','int8','int16'] rootn_output_type = ['float','float2','float4','float8','float16'] -- 2.7.4