Remove some unreasonable input values for rootn
authorYi Sun <yi.sun@intel.com>
Thu, 20 Feb 2014 01:32:32 +0000 (09:32 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Fri, 21 Feb 2014 03:03:02 +0000 (11:03 +0800)
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 <yi.sun@intel.com>
utests/utest_math_gen.py

index 2c701d1..20ae3f1 100755 (executable)
@@ -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']