def test_ADmath_tanhr(): f = ADmath.tanh(-5) assert f == np.tanh(-5)
def test_ADmath_tanh(): f = ADmath.tanh(ADnum(-5, der=1)) assert f.val == np.tanh(-5) assert f.der == 1 / (np.cosh(-5)**2) assert len(f.graph) == 1
def test_ADmath_tanhr(): f = ADmath.tanh(-5) assert f == np.tanh(-5)
def test_ADmath_tanh(): f = ADmath.tanh(ADnum(-5, der=1)) assert f.val == np.tanh(-5) assert f.der == 1 / (np.cosh(-5)**2) assert len(f.graph) == 1