def test_MrvTestCase_simple_log():
    expr = log(x)
    assert mrv(expr,x) == set([x])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert r == expr
    assert md == {x:x}
def test_MrvTestCase_page60_sec3_5():
    expr1 = log(log(x*exp(x*exp(x))+1))
    expr2 = exp(exp(log(log(x)+1/x)))
    expr = expr1 - expr2
    assert mrv(expr,x) == set([exp(x*exp(x))])
    d,md = {},{}
    r = mrv2(expr1,x,d,md)
    assert set(md.keys()) == set([exp(x*exp(x))])
def test_MrvTestCase_page60_sec3_5_2():
    expr2 = exp(exp(log(log(x)+1/x)))
    c = mrv_compare(expr2,x,x)
    assert c == '=',`c`
    assert mrv(expr2,x) == set([x])
    d,md = {},{}
    r = mrv2(expr2,x,d,md)
    assert set(md.keys()) == set([x])
def test_MrvTestCase_page41_4():
    expr = exp(1/x+exp(-x))
    assert mrv(expr,x) == set([exp(x)])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert set(md.keys()) == set([exp(x)])
def test_MrvTestCase_page41_ex3_13():
    expr = exp(x+exp(-x**2))
    assert mrv(expr,x) == set([exp(x**2)])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert set(md.keys()) == set([exp(x**2)])
def test_MrvTestCase_page41_2():
    expr = exp(x+exp(-exp(x)))
    assert mrv(expr,x) == set([exp(exp(x))])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert md.keys()[0] == exp(exp(x))
def test_MrvTestCase_page41_1():
    expr = exp(x+1/x)
    assert mrv(expr,x) == set([expr])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert md == {expr:r}
def test_MrvTestCase_simple_exp2():
    expr = exp(x**2)
    assert mrv(expr,x) == set([exp(x**2)])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert md == {expr:r}
def test_MrvTestCase_page60_sec3_5_1():
    expr1 = log(log(x*exp(x*exp(x))+1))
    assert mrv(expr1,x) == set([exp(x*exp(x))])
    d,md = {},{}
    r = mrv2(expr1,x,d,md)
    assert set(md.keys()) == set([exp(x*exp(x))])
Example #10
0
def test_MrvTestCase_page51_ex3_25():
    expr = (ln(ln(x)+ln(ln(x)))-ln(ln(x)))/ln(ln(x)+ln(ln(ln(x))))*ln(x)
    assert mrv(expr,x) == set([x])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert set(md.keys()) == set([x])
Example #11
0
def mrv(expr, var):
    d,md = {},{}
    mrv2(expr, var, d, md)
    return set(md.keys())
Example #12
0
def test_MrvTestCase_page44_ex3_17():
    expr = 1/exp(-x+exp(-x))-exp(x)
    assert mrv(expr,x) == set([exp(x), exp(x-exp(-x))])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert set(md.keys()) == set([exp(x), exp(x-exp(-x))])
Example #13
0
def test_MrvTestCase_page41_8():
    expr = log(x-log(x))/log(x)
    assert mrv(expr,x) == set([x])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert set(md.keys()) == set([x])
Example #14
0
def test_MrvTestCase_page41_5():
    expr = exp(x**2)+x*exp(x)+ln(x)**x/x
    assert mrv(expr,x) == set([exp(x**2)])
    d,md = {},{}
    r = mrv2(expr,x,d,md)
    assert set(md.keys()) == set([exp(x**2)])