def test_sinh_types(): with pytest.raises(TypeError): ef.sinh('x') with pytest.raises(TypeError): ef.sinh("1234")
def test_sinh_results(): X = AutoDiff(0.5, 2) f = ef.sinh(X) assert f.val == np.sinh(0.5) assert f.der == np.array([[2*np.cosh(0.5)]]) assert f.jacobian == np.array([[1*np.cosh(0.5)]])
def test_sinh_constant_results(): a = ef.sinh(0.5) assert a == np.sinh(0.5)
def test_sinh_results(): X = Dual(0.5, 2) f = ef.sinh(X) assert f.Real == np.sinh(0.5) assert f.Dual == np.array([[2 * np.cosh(0.5)]])