Module rateslib::dual

source ·
Expand description

Toolset for forward mode automatic differentiation (AD).

§AD Architecture

The entire rateslib library is built around three core numeric types: f64, Dual and Dual2. Obviously f64 allows for traditional computation, which benefits from efficient calculation leveraging BLAS, while Dual and Dual2 reduce performance of traditional calculation but provide efficient calculation of first order and second order derivatives, respectively. Derivatives are calculated using forward mode AD, similar, but not identical, to the Julia ForwardDiff library.

Mathematical operations are defined to give dual numbers the ability to combine, and flexibly reference different variables at any point during calculations.

Modules§

  • Standalone documentation pages.
  • Perform linear algebra operations involving Arrays of f64, Dual and Dual2.

Structs§

  • A dual number data type supporting first order derivatives.
  • A dual number data type supporting second order derivatives.

Enums§

Traits§

  • Provides calculations of first order gradients to all, or a set of provided, vars.
  • Provides calculations of second order gradients to all, or a set of provided, vars.
  • Functions for common mathematical operations.
  • Generic trait indicating a function exists to map one Number to another.
  • Manages the vars of the manifold associated with a dual number.

Functions§

  • Convert a Number of one ADOrder to another and consume the value.
  • Convert a Number of one ADOrder to another.