Index: tests/MathTest.cpp |
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp |
index de7ad1db78ed3a82c2e43aeaa87c3d11b6827a72..24e46f3097aea20d0f62277dd74aae2dd44eb5c2 100644 |
--- a/tests/MathTest.cpp |
+++ b/tests/MathTest.cpp |
@@ -382,15 +382,14 @@ |
} |
-template <typename RSqrtFn> |
-static void test_rsqrt(skiatest::Reporter* reporter, RSqrtFn rsqrt) { |
+static void test_rsqrt(skiatest::Reporter* reporter) { |
const float maxRelativeError = 6.50196699e-4f; |
// test close to 0 up to 1 |
float input = 0.000001f; |
for (int i = 0; i < 1000; ++i) { |
float exact = 1.0f/sk_float_sqrt(input); |
- float estimate = rsqrt(input); |
+ float estimate = sk_float_rsqrt(input); |
float relativeError = sk_float_abs(exact - estimate)/exact; |
REPORTER_ASSERT(reporter, relativeError <= maxRelativeError); |
input += 0.001f; |
@@ -400,7 +399,7 @@ |
input = 1.0f; |
for (int i = 0; i < 1000; ++i) { |
float exact = 1.0f/sk_float_sqrt(input); |
- float estimate = rsqrt(input); |
+ float estimate = sk_float_rsqrt(input); |
float relativeError = sk_float_abs(exact - estimate)/exact; |
REPORTER_ASSERT(reporter, relativeError <= maxRelativeError); |
input += 0.01f; |
@@ -410,7 +409,7 @@ |
input = 1000000.0f; |
for (int i = 0; i < 100; ++i) { |
float exact = 1.0f/sk_float_sqrt(input); |
- float estimate = rsqrt(input); |
+ float estimate = sk_float_rsqrt(input); |
float relativeError = sk_float_abs(exact - estimate)/exact; |
REPORTER_ASSERT(reporter, relativeError <= maxRelativeError); |
input += 754326.f; |
@@ -556,8 +555,7 @@ |
unittest_fastfloat(reporter); |
unittest_isfinite(reporter); |
unittest_half(reporter); |
- test_rsqrt(reporter, sk_float_rsqrt); |
- test_rsqrt(reporter, sk_float_rsqrt_portable); |
+ test_rsqrt(reporter); |
for (i = 0; i < 10000; i++) { |
SkFixed numer = rand.nextS(); |