findSubexprs(expr, simplify =FALSE, tag =".expr", verbose =FALSE,...)
Arguments
expr: An expression represented in a variety of ways. See Details.
simplify: Whether to simplify.
tag: to be attached to the returned object(s)
verbose: If TRUE, then diagnostic output will be printed as derivatives and simplifications are recognized.
...: Additional arguments, passed to nlsSimplify
.
Details
If expr contains repeated subexpressions, this function returns an expression to evaluate them just once and store them in temporary variables with names starting with the tag.
This function is used internally by codeDeriv.
Examples
findSubexprs(expression(x^2+ x^2), tag =".example")