JuliaSymbolics / SymbolicUtils.jl

Symbolic expressions, rewriting and simplification
https://docs.sciml.ai/SymbolicUtils/stable/
Other
536 stars 107 forks source link

Call quick cancel by default #421

Closed YingboMa closed 2 years ago

YingboMa commented 2 years ago

With this branch

julia> simplify_fractions.(simplify.(inv(A), expand=true)) * det(A)
2×2 Matrix{Num}:
  a[2, 2]  -a[1, 2]
 -a[2, 1]   a[1, 1]

On master:

julia> simplify_fractions.(simplify.(inv(A), expand=true)) * det(A)
2×2 Matrix{Num}:
  ((a[1, 1]*a[2, 2] - a[1, 2]*a[2, 1])*a[2, 2]) / (a[1, 1]*a[2, 2] - a[1, 2]*a[2, 1])  …  (-(a[1, 1]*a[2, 2] - a[1, 2]*a[2, 1])*a[1, 2]) / (a[1, 1]*a[2, 2] - a[1, 2]*a[2, 1])
 (-(a[1, 1]*a[2, 2] - a[1, 2]*a[2, 1])*a[2, 1]) / (a[1, 1]*a[2, 2] - a[1, 2]*a[2, 1])      ((a[1, 1]*a[2, 2] - a[1, 2]*a[2, 1])*a[1, 1]) / (a[1, 1]*a[2, 2] - a[1, 2]*a[2, 1])
shashi commented 2 years ago

I'm not looking forward to issues about how this is wrong.. Besides the right fix for the problem you quote is in #422

If we do this, I would also like to have SafeReal type in the same release.

shashi commented 2 years ago

Done in #425