Skip to main content

diff_forward

Function diff_forward 

Source
pub fn diff_forward(
    expr: ExprId,
    var: ExprId,
    pool: &ExprPool,
) -> Result<DerivedExpr<ExprId>, DiffError>
Expand description

Differentiate expr with respect to var using forward-mode (dual-number) automatic differentiation.

Returns the derivative expression after applying the rule-based simplifier. The derivation log records a single diff_forward step.

§Agreement with symbolic diff

For any polynomial or rational-function expression, diff_forward and diff (symbolic) produce structurally equal results after simplification. Property tests in this module verify this on random polynomials.