Crate dual_num

source ·
Expand description

Dual Numbers

Fully-featured Dual Number implementation with features for automatic differentiation of multivariate vectorial functions into gradients.

Usage

extern crate dual_num;

use dual_num::{Dual, Float, differentiate};

fn main() {
    // find partial derivative at x=4.0
    println!("{:.5}", differentiate(4.0f64, |x| {
        x.sqrt() + Dual::from_real(1.0)
    })); // 0.25000
}
Previous Work

Modules

Structs

Dual Number structure

Traits

Generic trait for floating point numbers
The base trait for numeric types, covering 0 and 1 values, comparisons, basic numeric operations, and string conversion.
Defines a multiplicative identity element for Self.
The basic scalar type for all structures of nalgebra.
Defines an additive identity element for Self.

Functions

Evaluates the function using dual numbers to get the partial derivative at the input point
Computes the state and partials of the provided function.
Computes the state and the partials matrix of the provided function with a preliminary time parameter.