#[macro_use] extern crate criterion; extern crate black_scholes; use criterion::{Criterion, ParameterizedBenchmark}; fn bench_black_scholes_american(c: &mut Criterion) { let r=0.03; let sig=0.3; let s0=50.0 as f64; let maturity=1.0; let strike=50.0; let alpha_div_sigma=move |_t:f64, _underlying:f64, _dt:f64, _width:usize| r/sig; let sigma_pr=move |_t:f64, _underlying:f64, _dt:f64, _width:usize| sig; let sigma_inv=move |_t:f64, x:f64, _dt:f64, _width:usize| (x*sig).exp(); let py_off=move |_t:f64, underlying:f64, _dt:f64, _width:usize| if strike