Remove dead code in math_brute_force (#1117)

* Remove dead code

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Remove tautological statements

PARALLEL_REFERENCE is unconditionally defined. Remove preprocessor
condition that always hold.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Remove unnecessary declarations

Also removed unused macro.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>

* Format code

An unnecessary scope was removed. This formats the code using
clang-format.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
This commit is contained in:
Marco Antognini
2021-01-20 15:01:59 +00:00
committed by GitHub
parent af6d55d68c
commit be93630330
8 changed files with 136 additions and 1023 deletions

View File

@@ -248,8 +248,6 @@ int TestFunc_mad(const Func *f, MTdata d, bool relaxedMode)
cl_program programs[VECTOR_SIZE_COUNT];
cl_kernel kernels[VECTOR_SIZE_COUNT];
float maxError = 0.0f;
// int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM &
// gFloatCapabilities);
float maxErrorVal = 0.0f;
float maxErrorVal2 = 0.0f;
float maxErrorVal3 = 0.0f;
@@ -263,11 +261,6 @@ int TestFunc_mad(const Func *f, MTdata d, bool relaxedMode)
gMaxVectorSizeIndex - gMinVectorSizeIndex,
&build_info)))
return error;
/*
for( i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++ )
if( (error = BuildKernel( f->nameInCode, (int) i, kernels + i,
programs + i) ) ) return error;
*/
for (i = 0; i < (1ULL << 32); i += step)
{
@@ -380,247 +373,8 @@ int TestFunc_mad(const Func *f, MTdata d, bool relaxedMode)
if (gSkipCorrectnessTesting) break;
// Verify data -- Commented out on purpose. no verification possible.
// Verify data -- No verification possible.
// MAD is a random number generator.
/*
uint32_t *t = gOut_Ref;
for( j = 0; j < bufferSize / sizeof( float ); j++ )
{
for( k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++ )
{
uint32_t *q = gOut[k];
// If we aren't getting the correctly rounded result
if( t[j] != q[j] )
{
float test = ((float*) q)[j];
double correct = f->func.f_fff( s[j], s2[j], s3[j]
); float err = Ulp_Error( test, correct ); int fail = ! (fabsf(err) <=
f->float_ulps);
if( fail && ftz )
{
// retry per section 6.5.3.2
if( IsFloatSubnormal(correct) )
{ // look at me,
fail = fail && ( test != 0.0f );
if( ! fail )
err = 0.0f;
}
// retry per section 6.5.3.3
if( fail && IsFloatSubnormal( s[j] ) )
{ // look at me,
double correct2 = f->func.f_fff( 0.0, s2[j],
s3[j] ); double correct3 = f->func.f_fff( -0.0, s2[j], s3[j] ); float
err2 = Ulp_Error( test, correct2 ); float err3 = Ulp_Error( test,
correct3 ); fail = fail && ((!(fabsf(err2) <= f->float_ulps)) &&
(!(fabsf(err3) <= f->float_ulps))); if( fabsf( err2 ) < fabsf(err ) )
err = err2;
if( fabsf( err3 ) < fabsf(err ) )
err = err3;
// retry per section 6.5.3.4
if( IsFloatResultSubnormal(correct2,
f->float_ulps ) || IsFloatResultSubnormal(correct3, f->float_ulps ) )
{ // look at me now,
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
//try with first two args as zero
if( IsFloatSubnormal( s2[j] ) )
{ // its fun to have fun,
correct2 = f->func.f_fff( 0.0, 0.0,
s3[j] ); correct3 = f->func.f_fff( -0.0, 0.0, s3[j] ); double correct4
= f->func.f_fff( 0.0, -0.0, s3[j] ); double correct5 = f->func.f_fff(
-0.0, -0.0, s3[j] ); err2 = Ulp_Error( test, correct2 ); err3 =
Ulp_Error( test, correct3 ); float err4 = Ulp_Error( test, correct4 );
float err5 = Ulp_Error( test, correct5
); fail = fail && ((!(fabsf(err2) <= f->float_ulps)) && (!(fabsf(err3)
<= f->float_ulps)) &&
(!(fabsf(err4) <=
f->float_ulps)) && (!(fabsf(err5) <= f->float_ulps))); if( fabsf( err2
) < fabsf(err ) ) err = err2; if( fabsf( err3 ) < fabsf(err ) ) err =
err3; if( fabsf( err4 ) < fabsf(err ) ) err = err4; if( fabsf( err5 ) <
fabsf(err ) ) err = err5;
// retry per section 6.5.3.4
if( IsFloatResultSubnormal(correct2,
f->float_ulps ) || IsFloatResultSubnormal(correct3, f->float_ulps ) ||
IsFloatResultSubnormal(correct4,
f->float_ulps ) || IsFloatResultSubnormal(correct5, f->float_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
if( IsFloatSubnormal( s3[j] ) )
{ // but you have to know how!
correct2 = f->func.f_fff( 0.0, 0.0,
0.0f ); correct3 = f->func.f_fff( -0.0, 0.0, 0.0f ); correct4 =
f->func.f_fff( 0.0, -0.0, 0.0f ); correct5 = f->func.f_fff( -0.0, -0.0,
0.0f ); double correct6 = f->func.f_fff( 0.0, 0.0, -0.0f ); double
correct7 = f->func.f_fff( -0.0, 0.0, -0.0f ); double correct8 =
f->func.f_fff( 0.0, -0.0, -0.0f ); double correct9 = f->func.f_fff(
-0.0, -0.0, -0.0f ); err2 = Ulp_Error( test, correct2 ); err3 =
Ulp_Error( test, correct3 ); err4 = Ulp_Error( test, correct4 ); err5
= Ulp_Error( test, correct5 ); float err6 = Ulp_Error( test, correct6
); float err7 = Ulp_Error( test, correct7 ); float err8 = Ulp_Error(
test, correct8 ); float err9 = Ulp_Error( test, correct9 ); fail =
fail && ((!(fabsf(err2) <= f->float_ulps)) && (!(fabsf(err3) <=
f->float_ulps)) &&
(!(fabsf(err4) <=
f->float_ulps)) && (!(fabsf(err5) <= f->float_ulps)) &&
(!(fabsf(err5) <=
f->float_ulps)) && (!(fabsf(err6) <= f->float_ulps)) &&
(!(fabsf(err7) <=
f->float_ulps)) && (!(fabsf(err8) <= f->float_ulps))); if( fabsf( err2
) < fabsf(err ) ) err = err2; if( fabsf( err3 ) < fabsf(err ) ) err =
err3; if( fabsf( err4 ) < fabsf(err ) ) err = err4; if( fabsf( err5 ) <
fabsf(err ) ) err = err5; if( fabsf( err6 ) < fabsf(err ) ) err = err6;
if( fabsf( err7 ) < fabsf(err ) )
err = err7;
if( fabsf( err8 ) < fabsf(err ) )
err = err8;
if( fabsf( err9 ) < fabsf(err ) )
err = err9;
// retry per section 6.5.3.4
if( IsFloatResultSubnormal(correct2,
f->float_ulps ) || IsFloatResultSubnormal(correct3, f->float_ulps ) ||
IsFloatResultSubnormal(correct4,
f->float_ulps ) || IsFloatResultSubnormal(correct5, f->float_ulps ) ||
IsFloatResultSubnormal(
correct6, f->float_ulps ) || IsFloatResultSubnormal(correct7,
f->float_ulps ) || IsFloatResultSubnormal(correct8, f->float_ulps ) ||
IsFloatResultSubnormal( correct9, f->float_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
}
}
else if( IsFloatSubnormal( s3[j] ) )
{
correct2 = f->func.f_fff( 0.0, s2[j],
0.0 ); correct3 = f->func.f_fff( -0.0, s2[j], 0.0 ); double correct4 =
f->func.f_fff( 0.0, s2[j], -0.0 ); double correct5 = f->func.f_fff(
-0.0, s2[j], -0.0 ); err2 = Ulp_Error( test, correct2 ); err3 =
Ulp_Error( test, correct3 ); float err4 = Ulp_Error( test, correct4 );
float err5 = Ulp_Error( test, correct5
); fail = fail && ((!(fabsf(err2) <= f->float_ulps)) && (!(fabsf(err3)
<= f->float_ulps)) &&
(!(fabsf(err4) <=
f->float_ulps)) && (!(fabsf(err5) <= f->float_ulps))); if( fabsf( err2
) < fabsf(err ) ) err = err2; if( fabsf( err3 ) < fabsf(err ) ) err =
err3; if( fabsf( err4 ) < fabsf(err ) ) err = err4; if( fabsf( err5 ) <
fabsf(err ) ) err = err5;
// retry per section 6.5.3.4
if( IsFloatResultSubnormal(correct2,
f->float_ulps ) || IsFloatResultSubnormal(correct3, f->float_ulps ) ||
IsFloatResultSubnormal(correct4,
f->float_ulps ) || IsFloatResultSubnormal(correct5, f->float_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
}
}
else if( fail && IsFloatSubnormal( s2[j] ) )
{
double correct2 = f->func.f_fff( s[j], 0.0,
s3[j] ); double correct3 = f->func.f_fff( s[j], -0.0, s3[j] ); float
err2 = Ulp_Error( test, correct2 ); float err3 = Ulp_Error( test,
correct3 ); fail = fail && ((!(fabsf(err2) <= f->float_ulps)) &&
(!(fabsf(err3) <= f->float_ulps))); if( fabsf( err2 ) < fabsf(err ) )
err = err2;
if( fabsf( err3 ) < fabsf(err ) )
err = err3;
// retry per section 6.5.3.4
if( IsFloatResultSubnormal(correct2,
f->float_ulps ) || IsFloatResultSubnormal(correct3, f->float_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
//try with second two args as zero
if( IsFloatSubnormal( s3[j] ) )
{
correct2 = f->func.f_fff( s[j], 0.0, 0.0
); correct3 = f->func.f_fff( s[j], -0.0, 0.0 ); double correct4 =
f->func.f_fff( s[j], 0.0, -0.0 ); double correct5 = f->func.f_fff(
s[j], -0.0, -0.0 ); err2 = Ulp_Error( test, correct2 ); err3 =
Ulp_Error( test, correct3 ); float err4 = Ulp_Error( test, correct4 );
float err5 = Ulp_Error( test, correct5
); fail = fail && ((!(fabsf(err2) <= f->float_ulps)) && (!(fabsf(err3)
<= f->float_ulps)) &&
(!(fabsf(err4) <=
f->float_ulps)) && (!(fabsf(err5) <= f->float_ulps))); if( fabsf( err2
) < fabsf(err ) ) err = err2; if( fabsf( err3 ) < fabsf(err ) ) err =
err3; if( fabsf( err4 ) < fabsf(err ) ) err = err4; if( fabsf( err5 ) <
fabsf(err ) ) err = err5;
// retry per section 6.5.3.4
if( IsFloatResultSubnormal(correct2,
f->float_ulps ) || IsFloatResultSubnormal(correct3, f->float_ulps ) ||
IsFloatResultSubnormal(correct4,
f->float_ulps ) || IsFloatResultSubnormal(correct5, f->float_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
}
}
else if( fail && IsFloatSubnormal(s3[j]) )
{
double correct2 = f->func.f_fff( s[j],
s2[j], 0.0 ); double correct3 = f->func.f_fff( s[j], s2[j], -0.0 );
float err2 = Ulp_Error( test, correct2 );
float err3 = Ulp_Error( test, correct3 );
fail = fail && ((!(fabsf(err2) <=
f->float_ulps)) && (!(fabsf(err3) <= f->float_ulps))); if( fabsf( err2
) < fabsf(err ) ) err = err2; if( fabsf( err3 ) < fabsf(err ) ) err =
err3;
// retry per section 6.5.3.4
if( IsFloatResultSubnormal(correct2,
f->float_ulps ) || IsFloatResultSubnormal(correct3, f->float_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
}
}
if( fabsf(err ) > maxError )
{
maxError = fabsf(err);
maxErrorVal = s[j];
maxErrorVal2 = s2[j];
maxErrorVal3 = s3[j];
}
if( fail )
{
vlog_error( "\nERROR: %s%s: %f ulp error at {%a,
%a, %a}: *%a vs. %a\n", f->name, sizeNames[k], err, s[j], s2[j], s3[j],
((float*) gOut_Ref)[j], test ); error = -1; goto exit;
}
}
}
}
*/
if (0 == (i & 0x0fffffff))
{
vlog(".");
@@ -758,7 +512,6 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode)
cl_program programs[VECTOR_SIZE_COUNT];
cl_kernel kernels[VECTOR_SIZE_COUNT];
float maxError = 0.0f;
// int ftz = f->ftz || gForceFTZ;
double maxErrorVal = 0.0f;
double maxErrorVal2 = 0.0f;
double maxErrorVal3 = 0.0f;
@@ -776,11 +529,6 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode)
{
return error;
}
/*
for( i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++ )
if( (error = BuildKernelDouble( f->nameInCode, (int) i, kernels +
i, programs + i) ) ) return error;
*/
for (i = 0; i < (1ULL << 32); i += step)
{
@@ -893,266 +641,8 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode)
if (gSkipCorrectnessTesting) break;
// Verify data -- Commented out on purpose. no verification possible.
// Verify data -- No verification possible.
// MAD is a random number generator.
/*
uint64_t *t = gOut_Ref;
for( j = 0; j < bufferSize / sizeof( double ); j++ )
{
for( k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++ )
{
uint64_t *q = gOut[k];
// If we aren't getting the correctly rounded result
if( t[j] != q[j] )
{
double test = ((double*) q)[j];
long double correct = f->dfunc.f_fff( s[j], s2[j],
s3[j] ); float err = Bruteforce_Ulp_Error_Double( test, correct ); int
fail = ! (fabsf(err) <= f->double_ulps);
if( fail && ftz )
{
// retry per section 6.5.3.2
if( IsDoubleResultSubnormal(correct,
f->double_ulps) ) { // look at me, fail = fail && ( test != 0.0f ); if(
! fail ) err = 0.0f;
}
// retry per section 6.5.3.3
if( fail && IsDoubleSubnormal( s[j] ) )
{ // look at me,
long double correct2 = f->dfunc.f_fff( 0.0,
s2[j], s3[j] ); long double correct3 = f->dfunc.f_fff( -0.0, s2[j],
s3[j] ); float err2 = Bruteforce_Ulp_Error_Double( test, correct2 );
float err3 = Bruteforce_Ulp_Error_Double(
test, correct3 ); fail = fail && ((!(fabsf(err2) <= f->double_ulps))
&& (!(fabsf(err3) <= f->double_ulps))); if( fabsf( err2 ) < fabsf(err )
) err = err2; if( fabsf( err3 ) < fabsf(err ) ) err = err3;
// retry per section 6.5.3.4
if( IsDoubleResultSubnormal( correct2,
f->double_ulps ) || IsDoubleResultSubnormal( correct3, f->double_ulps )
) { // look at me now, fail = fail && ( test != 0.0f); if( ! fail ) err
= 0.0f;
}
//try with first two args as zero
if( IsDoubleSubnormal( s2[j] ) )
{ // its fun to have fun,
correct2 = f->dfunc.f_fff( 0.0, 0.0,
s3[j] ); correct3 = f->dfunc.f_fff( -0.0, 0.0, s3[j] ); long double
correct4 = f->dfunc.f_fff( 0.0, -0.0, s3[j] ); long double correct5 =
f->dfunc.f_fff( -0.0, -0.0, s3[j] ); err2 =
Bruteforce_Ulp_Error_Double( test, correct2 ); err3 =
Bruteforce_Ulp_Error_Double( test, correct3 ); float err4 =
Bruteforce_Ulp_Error_Double( test, correct4 ); float err5 =
Bruteforce_Ulp_Error_Double( test, correct5 ); fail = fail &&
((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <=
f->double_ulps)) &&
(!(fabsf(err4) <=
f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps))); if( fabsf(
err2 ) < fabsf(err ) ) err = err2; if( fabsf( err3 ) < fabsf(err ) )
err = err3;
if( fabsf( err4 ) < fabsf(err ) )
err = err4;
if( fabsf( err5 ) < fabsf(err ) )
err = err5;
// retry per section 6.5.3.4
if( IsDoubleResultSubnormal( correct2,
f->double_ulps ) || IsDoubleResultSubnormal( correct3, f->double_ulps )
|| IsDoubleResultSubnormal( correct4, f->double_ulps ) ||
IsDoubleResultSubnormal( correct5, f->double_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
if( IsDoubleSubnormal( s3[j] ) )
{ // but you have to know how!
correct2 = f->dfunc.f_fff( 0.0, 0.0,
0.0f ); correct3 = f->dfunc.f_fff( -0.0, 0.0, 0.0f ); correct4 =
f->dfunc.f_fff( 0.0, -0.0, 0.0f ); correct5 = f->dfunc.f_fff( -0.0,
-0.0, 0.0f ); long double correct6 = f->dfunc.f_fff( 0.0, 0.0, -0.0f );
long double correct7 =
f->dfunc.f_fff( -0.0, 0.0, -0.0f ); long double correct8 =
f->dfunc.f_fff( 0.0, -0.0, -0.0f ); long double correct9 =
f->dfunc.f_fff( -0.0, -0.0, -0.0f ); err2 =
Bruteforce_Ulp_Error_Double( test, correct2 ); err3 =
Bruteforce_Ulp_Error_Double( test, correct3 ); err4 =
Bruteforce_Ulp_Error_Double( test, correct4 ); err5 =
Bruteforce_Ulp_Error_Double( test, correct5 ); float err6 =
Bruteforce_Ulp_Error_Double( test, correct6 ); float err7 =
Bruteforce_Ulp_Error_Double( test, correct7 ); float err8 =
Bruteforce_Ulp_Error_Double( test, correct8 ); float err9 =
Bruteforce_Ulp_Error_Double( test, correct9 ); fail = fail &&
((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <=
f->double_ulps)) &&
(!(fabsf(err4) <=
f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps)) &&
(!(fabsf(err5) <=
f->double_ulps)) && (!(fabsf(err6) <= f->double_ulps)) &&
(!(fabsf(err7) <=
f->double_ulps)) && (!(fabsf(err8) <= f->double_ulps))); if( fabsf(
err2 ) < fabsf(err ) ) err = err2; if( fabsf( err3 ) < fabsf(err ) )
err = err3;
if( fabsf( err4 ) < fabsf(err ) )
err = err4;
if( fabsf( err5 ) < fabsf(err ) )
err = err5;
if( fabsf( err6 ) < fabsf(err ) )
err = err6;
if( fabsf( err7 ) < fabsf(err ) )
err = err7;
if( fabsf( err8 ) < fabsf(err ) )
err = err8;
if( fabsf( err9 ) < fabsf(err ) )
err = err9;
// retry per section 6.5.3.4
if( IsDoubleResultSubnormal(
correct2, f->double_ulps ) || IsDoubleResultSubnormal( correct3,
f->double_ulps ) || IsDoubleResultSubnormal( correct4, f->double_ulps
) || IsDoubleResultSubnormal( correct5, f->double_ulps ) ||
IsDoubleResultSubnormal(
correct6, f->double_ulps ) || IsDoubleResultSubnormal( correct7,
f->double_ulps ) || IsDoubleResultSubnormal( correct8, f->double_ulps
) || IsDoubleResultSubnormal( correct9, f->double_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
}
}
else if( IsDoubleSubnormal( s3[j] ) )
{
correct2 = f->dfunc.f_fff( 0.0, s2[j],
0.0 ); correct3 = f->dfunc.f_fff( -0.0, s2[j], 0.0 ); long double
correct4 = f->dfunc.f_fff( 0.0, s2[j], -0.0 ); long double correct5 =
f->dfunc.f_fff( -0.0, s2[j], -0.0 ); err2 =
Bruteforce_Ulp_Error_Double( test, correct2 ); err3 =
Bruteforce_Ulp_Error_Double( test, correct3 ); float err4 =
Bruteforce_Ulp_Error_Double( test, correct4 ); float err5 =
Bruteforce_Ulp_Error_Double( test, correct5 ); fail = fail &&
((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <=
f->double_ulps)) &&
(!(fabsf(err4) <=
f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps))); if( fabsf(
err2 ) < fabsf(err ) ) err = err2; if( fabsf( err3 ) < fabsf(err ) )
err = err3;
if( fabsf( err4 ) < fabsf(err ) )
err = err4;
if( fabsf( err5 ) < fabsf(err ) )
err = err5;
// retry per section 6.5.3.4
if( IsDoubleResultSubnormal( correct2,
f->double_ulps ) || IsDoubleResultSubnormal( correct3, f->double_ulps )
|| IsDoubleResultSubnormal( correct4, f->double_ulps ) ||
IsDoubleResultSubnormal( correct5, f->double_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
}
}
else if( fail && IsDoubleSubnormal( s2[j] ) )
{
long double correct2 = f->dfunc.f_fff( s[j],
0.0, s3[j] ); long double correct3 = f->dfunc.f_fff( s[j], -0.0, s3[j]
); float err2 = Bruteforce_Ulp_Error_Double( test, correct2 ); float
err3 = Bruteforce_Ulp_Error_Double( test, correct3 ); fail = fail &&
((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <=
f->double_ulps))); if( fabsf( err2 ) < fabsf(err ) ) err = err2; if(
fabsf( err3 ) < fabsf(err ) ) err = err3;
// retry per section 6.5.3.4
if( IsDoubleResultSubnormal( correct2,
f->double_ulps ) || IsDoubleResultSubnormal( correct3, f->double_ulps
) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
//try with second two args as zero
if( IsDoubleSubnormal( s3[j] ) )
{
correct2 = f->dfunc.f_fff( s[j], 0.0,
0.0 ); correct3 = f->dfunc.f_fff( s[j], -0.0, 0.0 ); long double
correct4 = f->dfunc.f_fff( s[j], 0.0, -0.0 ); long double correct5 =
f->dfunc.f_fff( s[j], -0.0, -0.0 ); err2 = Bruteforce_Ulp_Error_Double(
test, correct2 ); err3 = Bruteforce_Ulp_Error_Double( test, correct3
); float err4 = Bruteforce_Ulp_Error_Double( test, correct4 ); float
err5 = Bruteforce_Ulp_Error_Double( test, correct5 ); fail = fail &&
((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <=
f->double_ulps)) &&
(!(fabsf(err4) <=
f->double_ulps)) && (!(fabsf(err5) <= f->double_ulps))); if( fabsf(
err2 ) < fabsf(err ) ) err = err2; if( fabsf( err3 ) < fabsf(err ) )
err = err3;
if( fabsf( err4 ) < fabsf(err ) )
err = err4;
if( fabsf( err5 ) < fabsf(err ) )
err = err5;
// retry per section 6.5.3.4
if( IsDoubleResultSubnormal( correct2,
f->double_ulps ) || IsDoubleResultSubnormal( correct3, f->double_ulps )
|| IsDoubleResultSubnormal( correct4, f->double_ulps ) ||
IsDoubleResultSubnormal( correct5, f->double_ulps ) )
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
}
}
else if( fail && IsDoubleSubnormal(s3[j]) )
{
long double correct2 = f->dfunc.f_fff( s[j],
s2[j], 0.0 ); long double correct3 = f->dfunc.f_fff( s[j], s2[j], -0.0
); float err2 = Bruteforce_Ulp_Error_Double( test, correct2 ); float
err3 = Bruteforce_Ulp_Error_Double( test, correct3 ); fail = fail &&
((!(fabsf(err2) <= f->double_ulps)) && (!(fabsf(err3) <=
f->double_ulps))); if( fabsf( err2 ) < fabsf(err ) ) err = err2; if(
fabsf( err3 ) < fabsf(err ) ) err = err3;
// retry per section 6.5.3.4
if( IsDoubleResultSubnormal( correct2,
f->double_ulps ) || IsDoubleResultSubnormal( correct3, f->double_ulps )
)
{
fail = fail && ( test != 0.0f);
if( ! fail )
err = 0.0f;
}
}
}
if( fabsf(err ) > maxError )
{
maxError = fabsf(err);
maxErrorVal = s[j];
maxErrorVal2 = s2[j];
maxErrorVal3 = s3[j];
}
if( fail )
{
vlog_error( "\nERROR: %sD%s: %f ulp error at
{%a, %a, %a}: *%a vs. %a\n", f->name, sizeNames[k], err, s[j], s2[j],
s3[j], ((double*) gOut_Ref)[j], test ); error = -1; goto exit;
}
}
}
}
*/
if (0 == (i & 0x0fffffff))
{
vlog(".");