findSubexprs: findSubexprs

View source: R/derivs.R

findSubexprsR Documentation

findSubexprs

Description

Find common sub-expressions in expr.

Usage

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")

nlsr documentation built on Sept. 8, 2023, 5:48 p.m.