Esempio n. 1
0
def test_ADmath_logr():
    f = ADmath.log(72)
    assert f == np.log(72)
Esempio n. 2
0
def test_5x2lnx():
    x = ADnum(1, der=1)
    f = 5 * x**2 * ADmath.log(x)
    assert f.val == 0.0
    assert f.der == 10 * 1.0 * np.log(1.0) + 5 * 1.0
Esempio n. 3
0
def test_ADmath_log():
    f = ADmath.log(ADnum(72, der=1))
    assert f.val == np.log(72)
    assert f.der == 1 / 72
    assert len(f.graph) == 1