Expand description
Automatic differentiation using dual numbers.
A dual number a + b·ε where ε² = 0 carries both the value and
the derivative of a function at a point. Evaluating f(Dual(x, 1))
yields Dual(f(x), f'(x)) in a single forward pass — no symbolic
differentiation needed, and it works for arbitrary compositions.
This module provides:
Structs§
- Dual
- A first-order dual number:
value + deriv * εwhereε² = 0.
Functions§
- derivative
- Compute the derivative of
f(var)atxusing automatic differentiation. - eval
- Evaluate an
ExprAST using dual numbers, returning the value and derivative. - gradient
- Compute the gradient of a multivariate expression at a point.
- jacobian
- Compute the Jacobian matrix of a system of expressions.