This function identifies all repeated subexpressions in an expression vector,
and stores them in locally created variables. It is used by fnDeriv
to share common subexpressions between expression evaluations and gradient
evaluations, for example.
If simplify
is TRUE
, the assumptions behind the simplifications done
by nlsSimplify
must be valid for the result to match the input. With
the default simplifications, this means that all variables should take finite
real values.