SymbolicUtils.jl icon indicating copy to clipboard operation
SymbolicUtils.jl copied to clipboard

Improve `simplify` rules for factorization

Open bowenszhu opened this issue 1 year ago • 1 comments

using SymbolicUtils
@syms x y z
expr = x * y + x * z
res = simplify(expr) # return x*(y + z). Good!
using SymbolicUtils
@syms a b c d
expr = a * b * c + c * a * d
res = simplify(expr) # return a*b*c + a*c*d. Bad!
(@v1.8) pkg> st -m SymbolicUtils
Status `~/.julia/environments/v1.8/Manifest.toml`
  [d1185830] SymbolicUtils v0.19.11

This looks simple, but is fundamentally important for generating computationally inexpensive functions.

bowenszhu avatar Nov 22 '22 05:11 bowenszhu