We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee10b08 commit 4f6ea1bCopy full SHA for 4f6ea1b
src/simplify.jl
@@ -62,9 +62,9 @@ function <ₑ(a::Sym, b::Term)
62
# both subterms are terms, so it's definitely firster
63
return true
64
elseif n1
65
- return a <ₑ args[1]
+ return isequal(a, args[1]) || a <ₑ args[1]
66
elseif n2
67
- return a <ₑ args[2]
+ return isequal(a, args[2]) || a <ₑ args[2]
68
else
69
# both arguments are not numbers
70
# This case when a <ₑ Term(^, [1,-1])
test/order.jl
@@ -63,3 +63,13 @@ end
@test a(t) <ₑ b(t)
@test !(b(t) <ₑ a(t))
end
+
+@testset "Sym vs Term" begin
+ @syms x
+ @test x <ₑ (3 + x) && !((3 + x) <ₑ x)
71
+ @test x^2 <ₑ y && !(y <ₑ x^2)
72
73
+ # a nice consequence
74
+ @test simplify(x/(x+3) + 3/(x+3)) == 1
75
+end
0 commit comments