Lines Matching full:roots

31                     "Invalid test case, up to 2 roots allowed");  in testQuadRootsReal()
42 "Invalid test case root %zu. Roots should be sorted in ascending order", i); in testQuadRootsReal()
48 double roots[2] = {0, 0}; in testQuadRootsReal() local
49 int rootCount = SkDQuad::RootsReal(A, B, C, roots); in testQuadRootsReal()
51 "Wrong number of roots returned %zu != %d", expectedRoots.size(), in testQuadRootsReal()
54 // We don't care which order the roots are returned from the algorithm. in testQuadRootsReal()
56 std::sort(std::begin(roots), std::begin(roots) + rootCount); in testQuadRootsReal()
59 REPORTER_ASSERT(reporter, sk_double_nearly_zero(roots[i]), in testQuadRootsReal()
60 "0 != %.16f at index %d", roots[i], i); in testQuadRootsReal()
63 sk_doubles_nearly_equal_ulps(expectedRoots[i], roots[i], 64), in testQuadRootsReal()
64 "%.16f != %.16f at index %d", expectedRoots[i], roots[i], i); in testQuadRootsReal()
70 double roots[2] = {0, 0}; in testQuadRootsReal() local
71 int rootCount = SkQuads::RootsReal(A, B, C, roots); in testQuadRootsReal()
73 "Wrong number of roots returned %zu != %d", expectedRoots.size(), in testQuadRootsReal()
76 // We don't care which order the roots are returned from the algorithm. in testQuadRootsReal()
78 std::sort(std::begin(roots), std::begin(roots) + rootCount); in testQuadRootsReal()
81 REPORTER_ASSERT(reporter, sk_double_nearly_zero(roots[i]), in testQuadRootsReal()
82 "0 != %.16f at index %d", roots[i], i); in testQuadRootsReal()
85 sk_doubles_nearly_equal_ulps(expectedRoots[i], roots[i], 64), in testQuadRootsReal()
86 "%.16f != %.16f at index %d", expectedRoots[i], roots[i], i); in testQuadRootsReal()
95 testQuadRootsReal(reporter, "two roots 3x^2 - 20x - 40", in DEF_TEST()
104 testQuadRootsReal(reporter, "two roots 2x^2 + 30x - 68", in DEF_TEST()
108 testQuadRootsReal(reporter, "two roots x^2 - 5", in DEF_TEST()
120 testQuadRootsReal(reporter, "no roots 5x^2 + 6x + 7", in DEF_TEST()
124 testQuadRootsReal(reporter, "no roots 4x^2 + 1", in DEF_TEST()
156 // The roots are not in the range of doubles. in DEF_TEST()
182 double roots[2]; in DEF_TEST() local
184 SkQuads::RootsReal(DBL_MAX, 0, DBL_MAX, roots) == 0, in DEF_TEST()
188 SkQuads::RootsReal(DBL_MAX, DBL_MAX, DBL_MAX, roots) == 0, in DEF_TEST()
193 SkQuads::RootsReal(1, NAN, -3, roots) == 0, in DEF_TEST()
197 SkQuads::RootsReal(0, NAN, 3, roots) == 0, in DEF_TEST()
201 SkQuads::RootsReal(0, 0, NAN, roots) == 0, in DEF_TEST()
227 auto [discriminant, r0, r1] = SkQuads::Roots(1, -0.5 * -2, 1); in DEF_TEST()
234 auto [discriminant, r0, r1] = SkQuads::Roots(1, -0.5 * 4, 4); in DEF_TEST()
240 // Test the roots using
242 // The roots are (F_(n–1) ± 1)/F_n if n is even otherwise there are no roots.
251 auto [discriminant, r0, r1] = SkQuads::Roots(F[0], F[1], F[2]); in DEF_TEST()
254 // There are only real roots when i is even. in DEF_TEST()
370 auto [discriminate, r0, r1] = SkQuads::Roots(A, -0.5*B, C); in DEF_TEST()