Ejemplo n.º 1
0
def test_log_con():
    """Boolean condition asserts that value and derivative of the natural logarithm of the AutoDiff instance are equal to the expected value and derivative as calculated in the function for the case in which x is a real number.

    RETURNS
    ========
    If the boolean condition returns True nothing is returned. If it is computed to be false, then an AssertionError is raised.
    """
    c = 14
    assert {
        'diff': EF.log(c).der,
        'value': EF.log(c).val
    } == {
        'diff': 0,
        'value': math.log(c)
    }
Ejemplo n.º 2
0
 def logtarget(*arg):
     return EF.log(target(*arg))
Ejemplo n.º 3
0
 def myfunc(x, y):
     a = EF.exp_base(2, x)  #base 2 and exponent x
     b = EF.logistic(y)
     c = EF.log(y, 2)  #log with base 2
     return a + b + c
Ejemplo n.º 4
0
 def myfunc(x):
     f1 = EF.log(x)
     return f1