Skip to main content

simplify_derivative

Function simplify_derivative 

Source
pub fn simplify_derivative(expr: TLExpr) -> TLExpr
Expand description

Basic algebraic simplification applied to derivative expressions.

Simplification rules:

  • 0 + x → x, x + 0 → x
  • 0 * x → 0, x * 0 → 0
  • 1 * x → x, x * 1 → x
  • x - 0 → x
  • 0 - c → -c (constant folding for arithmetic negation form)
  • 0 / x → 0
  • x ^ 0 → 1, x ^ 1 → x
  • constant folding for pure-constant arithmetic nodes