Function simplifyCore #

simplifyCore() performs single pass simplification suitable for applications requiring ultimate performance. To roughly summarize, it handles cases along the lines of simplifyConstant() but where knowledge of a single argument is sufficient to determine the value. In contrast, simplify() extends simplifyCore() with additional passes to provide deeper simplification (such as gathering like terms).

Specifically, simplifyCore:

Syntax #

math.simplifyCore(expr)
math.simplifyCore(expr, options)

Parameters #

Parameter Type Description
node Node | string The expression to be simplified
options Object Simplification options, as per simplify()

Returns #

Type Description
Node Returns expression with basic simplifications applied

Throws #

Type | Description —- | ———–

Examples #

const f = math.parse('2 * 1 * x ^ (1 - 0)')
math.simplifyCore(f)                          // Node "2 * x"
math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node "2 * x"

See also #

simplify, simplifyConstant, resolve, derivative

Fork me on GitHub