Example #1
0
 def test_case4_l3(self):
     val = l(case4_f_x, e3, f_v=case4_f_v) - B(
         case4_f_u_v, u=case4_u_shift, v=e3)
     result = isclose(val, 1 / 6 + 1, abs_tol=EPSILON)
     self.assertIs(result, True)
Example #2
0
 def test_case1_l2(self):
     result = isclose(l(case1_f_x, e2, f_v=lambda v: 0),
                      1 / 3,
                      abs_tol=EPSILON)
     self.assertIs(result, True)
Example #3
0
 def test_case4_l1(self):
     val = l(case4_f_x, e1, f_v=case4_f_v) - B(
         case4_f_u_v, u=case4_u_shift, v=e1)
     result = isclose(val, 1 / 3 - 6 - 1 / 9, abs_tol=EPSILON)
     self.assertIs(result, True)
Example #4
0
 def test_case3_l2(self):
     val = l(case3_f_x, e2, f_v=case3_f_v)
     result = isclose(val, 2 / 9, abs_tol=EPSILON)
     self.assertIs(result, True)
Example #5
0
 def test_case3_l0(self):
     val = l(case3_f_x, e0, f_v=case3_f_v)
     result = isclose(val, 1 / 54 - 1, abs_tol=EPSILON)
     self.assertIs(result, True)
Example #6
0
 def test_case2_l2(self):
     val = l(case2_f_x, e2, f_v=lambda v: 0) - B(case2_f_u_v, u=e3, v=e2)
     result = isclose(val, 2 / 9 - 3.5, abs_tol=EPSILON)
     self.assertIs(result, True)
Example #7
0
 def test_case2_l1(self):
     val = l(case2_f_x, e1, f_v=lambda v: 0) - B(case2_f_u_v, u=e3, v=e1)
     result = isclose(val, 1 / 9, abs_tol=EPSILON)
     self.assertIs(result, True)