def test1(self): x_hat = np.array([0.999]) print("diff: ", np.log(x_hat) - np.array([student_ln(x) for x in x_hat])) assert np.all( np.abs(np.log(x_hat) - np.array([student_ln(x) for x in x_hat])) < EPSILON)
def test3(self): assert float('-inf') == student_ln(0)
def test2(self): assert np.abs(student_ln(np.e) - 1.0) < EPSILON
def test1(self): x_hat = np.array([10, 20, 30]) assert np.all( np.abs(np.log(x_hat) - np.array([student_ln(x) for x in x_hat])) < EPSILON)