def test_7(self): res = inputs("-x/y + 2*log(x) + 1", 1, 3, 1, 1, 0.1) self.assertEqual(res, ([ 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0 ], [ 1, 1.0048567711392322, 1.019027360425735, 1.0422423991076557, 1.0745891546604185, 1.1164176827487045, 1.1682544866049964, 1.2307201796473815, 1.304452301085999, 1.3900375929345512, 1.4879589748246138, 1.5985610609871461, 1.7220351442129154, 1.8584214330013147, 2.0076241171832523, 2.1694340543748374, 2.3435543428600427, 2.529625240509925, 2.727246255127115, 2.9359944054001117, 3.1554384846421533 ]))
def test_4(self): res = inputs("-(x+y)/x", 1, 3, 1, 1 / 2, 0.1) self.assertEqual(res, ([ 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0 ], [ 0.5, 0.35909090909090907, 0.2333333333333333, 0.1192307692307692, 0.014285714285714277, -0.08333333333333336, -0.17500000000000002, -0.26176470588235295, -0.34444444444444444, -0.4236842105263158, -0.5, -0.5738095238095238, -0.6454545454545454, -0.7152173913043478, -0.7833333333333333, -0.85, -0.9153846153846154, -0.9796296296296296, -1.042857142857143, -1.1051724137931036, -1.1666666666666667 ]))
def test_1(self): res = inputs("2", 3, 4, 3, 5, 0.1) for i in range(len(res[0])): self.assertTrue(abs(res[1][i] - (2 * res[0][i] - 1)) < e)
def test_6(self): res = inputs("-x/y + 2*log(x) + 1", 5, 3, 1, 1, 0.1) self.assertEqual(res, "a > b")
def test_3(self): res = inputs("-x/y + 2*lor(x) + 1", 1, 3, 1, 1, 0.1) self.assertEqual(res, "Неправильна вхідна функція")
def test_2(self): res = inputs("-x/y", 0, 1, 0, 2, 0.1) for i in range(len(res[0])): self.assertTrue(abs(res[1][i] - (sqrt(4 - res[0][i]**2))) < e)