Be more systematic about CSE
As we have seen in !86 (merged) it's not trivial to come up with substitutions for CSE (common subexpression elimination) to minimize the number of products. In the current form of the algorithm it requires substantial work to come up, implement and analyze a substitution choice.
There are a fair number of options for substitution, and we are not sure whether our current choice is optimal. On top of that, it could be that different choices are optimal for different perturbations. Or, we could even prefer a different heuristic than number of products, e.g. most compact expressions for symbolic computation.
The refactoring of the algorithm in #118 (closed) could help us with defining, testing and analyzing different substitutions. Once that is implemented, we should explore how we can be more systematic with CSE.
Blocked by #118 (closed).