From: Carol Eidt Date: Fri, 13 May 2016 17:57:18 +0000 (-0700) Subject: Fix CircleInConvex to check result within 1 ULP X-Git-Tag: accepted/tizen/base/20180629.140029~4671^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cde5a27915541a3d9388d4c16145e1b67441a3f6;p=platform%2Fupstream%2Fcoreclr.git Fix CircleInConvex to check result within 1 ULP This test was checking for the result to be within epsilon of the expected result, but this is not correct unless the algorithm is evaluating all interim results to a larger precision. It would also be more reasonable for the test to compute the expected result (e.g. using an alternate algorithm), and it would also be nice to have a method to compute ULP for a given value, but those are beyond the scope of this fix. Re-enable the test except for RyuJIT/x86. Fix #3964 --- diff --git a/tests/issues.targets b/tests/issues.targets index addeacf..5f32728 100644 --- a/tests/issues.targets +++ b/tests/issues.targets @@ -306,12 +306,6 @@ needs triage - - 3964 - - - 3964 - needs triage @@ -341,5 +335,11 @@ 4844 + + 4992 + + + 4992 + diff --git a/tests/src/JIT/SIMD/CircleInConvex.cs b/tests/src/JIT/SIMD/CircleInConvex.cs index a2c0c32..c858386 100644 --- a/tests/src/JIT/SIMD/CircleInConvex.cs +++ b/tests/src/JIT/SIMD/CircleInConvex.cs @@ -17,7 +17,7 @@ namespace ClassLibrary public class test { - const float EPS = 1E-9F; + const float EPS = Single.Epsilon; const int steps = 100; const float INF = Single.PositiveInfinity; @@ -259,8 +259,9 @@ namespace ClassLibrary float r; FindCircle(points, out O, out r); - float expRes = 7.565624E7F; - if (Math.Abs(r - expRes) > EPS) + float expRes = 75656240.0F; + float ulp = 8.0F; + if (Math.Abs(r - expRes) <= ulp) return 100; return 0; } diff --git a/tests/x86_legacy_backend_issues.targets b/tests/x86_legacy_backend_issues.targets index a61929c..15b3c61 100644 --- a/tests/x86_legacy_backend_issues.targets +++ b/tests/x86_legacy_backend_issues.targets @@ -175,9 +175,6 @@ needs triage - - needs triage - needs triage @@ -271,9 +268,6 @@ needs triage - - needs triage - needs triage