peroxide 0.33.3

Rust comprehensive scientific computation library contains linear algebra, numerical analysis, statistics and machine learning tools with farmiliar syntax
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use peroxide::fuga::*;

fn main() {
    let x = AD2(1f64, 1f64, 0f64);
    let y = AD2(1f64, 1f64, 0f64);
    let x0 = AD2(1f64, 0f64, 0f64);
    let y0 = AD2(1f64, 0f64, 0f64);

    let dy = f(x, y);
    dy.print();

    let dy0 = f(x0, y0);
    dy0.print();
}

fn f(x: AD, y: AD) -> AD {
    (1f64 - x).powi(2) + 5f64 * (y - x.powi(2)).powi(2)
}