Skip to content

Commit

Permalink
Math bruteforce test - enable erf/erfc functions (#1289)
Browse files Browse the repository at this point in the history
It was disabled because lack of reference implementation. However the
reference implementation exists. Then no reason to start testing these
functions.
  • Loading branch information
gwawiork authored Oct 1, 2024
1 parent 7e859cc commit 97cf4c7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test_conformance/math_brute_force/function_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ const Func functionList[] = {
ENTRY(cosh, 4.0f, 4.0f, 2.f, FTZ_OFF, unaryF),
ENTRY_EXT(cospi, 4.0f, 4.0f, 2.f, 0.00048828125f, FTZ_OFF, unaryF,
0.00048828125f), // relaxed ulp 2^-11
//ENTRY(erfc, 16.0f, 16.0f, FTZ_OFF, unaryF), //disabled for 1.0 due to lack of reference implementation
//ENTRY(erf, 16.0f, 16.0f, FTZ_OFF, unaryF), //disabled for 1.0 due to lack of reference implementation
ENTRY(erfc, 16.0f, 16.0f, 4.0f, FTZ_OFF, unaryF),
ENTRY(erf, 16.0f, 16.0f, 4.0f, FTZ_OFF, unaryF),

// relaxed error is overwritten in unary.c as it is 3+floor(fabs(2*x))
ENTRY_EXT(exp, 3.0f, 4.0f, 2.f, 3.0f, FTZ_OFF, unaryF, 4.0f),
Expand Down
2 changes: 1 addition & 1 deletion test_conformance/math_brute_force/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static test_definition test_list[] = {
ADD_TEST(half_sin), ADD_TEST(half_sqrt), ADD_TEST(half_tan),
ADD_TEST(add), ADD_TEST(subtract), ADD_TEST(divide),
ADD_TEST(divide_cr), ADD_TEST(multiply), ADD_TEST(assignment),
ADD_TEST(not),
ADD_TEST(not ), ADD_TEST(erf), ADD_TEST(erfc),
};

#undef ADD_TEST
Expand Down
6 changes: 6 additions & 0 deletions test_conformance/math_brute_force/reference_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5764,3 +5764,9 @@ int reference_notl(long double x)
int r = !x;
return r;
}

long double reference_erfcl(long double x) { return erfc(x); }
long double reference_erfl(long double x) { return erf(x); }

double reference_erfc(double x) { return erfc(x); }
double reference_erf(double x) { return erf(x); }
4 changes: 4 additions & 0 deletions test_conformance/math_brute_force/reference_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,8 @@ long double reference_ldexpl(long double x, int n);
long double reference_assignmentl(long double x);
int reference_notl(long double x);

long double reference_erfcl(long double x);
long double reference_erfl(long double x);
double reference_erfc(double x);
double reference_erf(double x);
#endif

0 comments on commit 97cf4c7

Please sign in to comment.