Maxima Function
optimize (expr)
Returns an expression that produces the same value and
side effects as expr but does so more efficiently by avoiding the
recomputation of common subexpressions. optimize
also has the side
effect of "collapsing" its argument so that all common subexpressions
are shared.
Do example (optimize)
for examples.