I demonstrate what I mean with this using HomotopyContinuation.jl.
using HomotopyContinuation
@var x
f = System([4*x^4+3*x^3+2*x^2+x-5])
Given a symbolic system of polynomials f
, in HC.jl there are two ways
to optimize them for numerical evaluation.
First the expression is optimized with similar techniques as you do (common subexpression elimination and then a simple multivariate horner-schema).