func TestThreePoint(t *testing.T) { test_cases := diff_test[0].XYs() for i, c := range test_cases { if !util.Tolerance(ThreePoint(diff_test[0].f, c.X), c.Y, tol) { t.Errorf("Three point out of tolerance. i = %v, diff = %.6f", i, math.Abs(c.Y-c.X)) } } }
func TestCentral9(t *testing.T) { test_cases := diff_test[8].XYs() algo := NewCentral(diff_test[8].f) for i, c := range test_cases { if !util.Tolerance(algo.Compute(c.X), c.Y, tol) { t.Errorf("Central out of tolerance. Function 9: i = %v, diff = %.6f, error = %.6f", i, math.Abs(c.Y-algo.Compute(c.X)), algo.er) } } }