MathOptInterface.jl
MathOptInterface.jl copied to clipboard
[Nonlinear] detect common subexpressions
There is tooling in MOI.Nonlinear.ReverseAD
to exploit common subexpressions, but we don't actively exploit this when parsing ScalarNonlinearFunction.
I wonder if we could walk the tape somehow to detect and reduce common subexpressions that are at least N nodes long.
It would help: https://github.com/jump-dev/JuMP.jl/issues/3729#issuecomment-2060549713