def test_ADmath_sqrtr(): f = ADmath.sqrt(40) assert f == np.sqrt(40)
def test_ADmath_sqrt(): f = ADmath.sqrt(ADnum(40, der=1)) assert f.val == np.sqrt(40) assert f.der == 1 / (2 * np.sqrt(40)) assert len(f.graph) == 1