Beispiel #1
0
def test_combine_inverse():
    x, y = var("x y")
    assert Mul._combine_inverse(x * I * y, x * I) == y
    assert Mul._combine_inverse(x * I * y, y * I) == x
    assert Mul._combine_inverse(oo * I * y, y * I) == oo
    assert Mul._combine_inverse(oo * I * y, oo * I) == y
    assert Add._combine_inverse(oo, oo) == S(0)
    assert Add._combine_inverse(oo * I, oo * I) == S(0)
Beispiel #2
0
def test_combine_inverse():
    x, y = symbols("x y")
    assert Mul._combine_inverse(x*I*y, x*I) == y
    assert Mul._combine_inverse(x*I*y, y*I) == x
    assert Mul._combine_inverse(oo*I*y, y*I) == oo
    assert Mul._combine_inverse(oo*I*y, oo*I) == y
    assert Add._combine_inverse(oo, oo) == S(0)
    assert Add._combine_inverse(oo*I, oo*I) == S(0)
Beispiel #3
0
def test__combine_inverse():
    x, y = symbols("x y")
    assert Mul._combine_inverse(x*I*y, x*I) == y
    assert Mul._combine_inverse(x*I*y, y*I) == x
    assert Mul._combine_inverse(oo*I*y, y*I) == oo
    assert Mul._combine_inverse(oo*I*y, oo*I) == y
    assert Add._combine_inverse(oo, oo) == S(0)
    assert Add._combine_inverse(oo*I, oo*I) == S(0)
    assert Add._combine_inverse(x*oo, x*oo) == S(0)
    assert Add._combine_inverse(-x*oo, -x*oo) == S(0)
    assert Add._combine_inverse((x - oo)*(x + oo), -oo)
def test__combine_inverse():
    x, y = symbols("x y")
    assert Mul._combine_inverse(x * I * y, x * I) == y
    assert Mul._combine_inverse(x * I * y, y * I) == x
    assert Mul._combine_inverse(oo * I * y, y * I) == oo
    assert Mul._combine_inverse(oo * I * y, oo * I) == y
    assert Add._combine_inverse(oo, oo) == S(0)
    assert Add._combine_inverse(oo * I, oo * I) == S(0)
    assert Add._combine_inverse(x * oo, x * oo) == S(0)
    assert Add._combine_inverse(-x * oo, -x * oo) == S(0)
    assert Add._combine_inverse((x - oo) * (x + oo), -oo)
Beispiel #5
0
def test__combine_inverse():
    x, y = symbols("x y")
    assert Mul._combine_inverse(x * I * y, x * I) == y
    assert Mul._combine_inverse(x * x**(1 + y), x**(1 + y)) == x
    assert Mul._combine_inverse(x * I * y, y * I) == x
    assert Mul._combine_inverse(oo * I * y, y * I) is oo
    assert Mul._combine_inverse(oo * I * y, oo * I) == y
    assert Mul._combine_inverse(oo * I * y, oo * I) == y
    assert Mul._combine_inverse(oo * y, -oo) == -y
    assert Mul._combine_inverse(-oo * y, oo) == -y
    assert Add._combine_inverse(oo, oo) is S.Zero
    assert Add._combine_inverse(oo * I, oo * I) is S.Zero
    assert Add._combine_inverse(x * oo, x * oo) is S.Zero
    assert Add._combine_inverse(-x * oo, -x * oo) is S.Zero
    assert Add._combine_inverse((x - oo) * (x + oo), -oo)