Simplify: Symbollic simplification of an expression or function

Description Usage Arguments Details Value

View source: R/Simplify.R

Description

Symbollic simplification of an expression or function

Usage

1
2
3
4
5
Simplify(expr, env = parent.frame(), scache = new.env())

Cache(st, env = Leaves(st), prefix = "")

deCache(st)

Arguments

expr

An expression to be simplified, expr can be

  • an expression: expression(x+x)

  • a string: "x+x"

  • a function: function(x) x+x

  • a right hand side of a formula: ~x+x

  • a language: quote(x+x)

env

An environment in which a simplified function is created if expr is a function. This argument is ignored in all other cases.

scache

An environment where there is a list in which simplified expression are cached

st

A language expression to be cached

prefix

A string to start the names of the cache variables

Details

An environment simplifications containing simplification rules, is exported in the namespace accessible by the user. Cache() is used to remove redundunt calculations by storing them in cache variables. Default parameters to Cache() does not have to be provided by user. deCache() makes the inverse job – a series of assignements are replaced by only one big expression without assignement. Sometimes it is usefull to apply deChache() and only then pass its result to Cache().

Value

A simplified expression. The result is of the same type as expr except for formula, where a language is returned.


Deriv documentation built on Feb. 24, 2021, 5:07 p.m.