Crates.io | dual_num |
lib.rs | dual_num |
version | 0.2.7 |
source | src |
created_at | 2017-06-05 14:34:53.973029 |
updated_at | 2019-04-03 13:06:50.621607 |
description | Fully-featured Dual Number implementation with features for automatic differentiation of multivariate vectorial functions into gradients |
homepage | |
repository | https://github.com/novacrazy/dual_num |
max_upload_size | |
id | 17831 |
size | 27,485 |
Fully-featured Dual Number implementation with features for automatic differentiation of multivariate vectorial functions into gradients.
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
}