MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / testHornerPolyR

Method testHornerPolyR

JSAT/test/jsat/math/MathTricksTest.java:118–128  ·  view source on GitHub ↗

Test of hornerPolyR method, of class MathTricks.

()

Source from the content-addressed store, hash-verified

116 * Test of hornerPolyR method, of class MathTricks.
117 */
118 @Test
119 public void testHornerPolyR()
120 {
121 System.out.println("hornerPolyR");
122 double[] coef = new double[]{1, -4, 0, 8, 1};
123 assertEquals(1, MathTricks.hornerPolyR(coef, 0), 1e-15);
124 assertEquals(6, MathTricks.hornerPolyR(coef, 1), 1e-15);
125 assertEquals(481, MathTricks.hornerPolyR(coef, 6), 1e-15);
126 assertEquals(2113, MathTricks.hornerPolyR(coef, -6), 1e-15);
127
128 }
129
130 /**
131 * Test of hornerPoly method, of class MathTricks.

Callers

nothing calls this directly

Calls 1

hornerPolyRMethod · 0.95

Tested by

no test coverage detected