Linux | Codecov |
---|---|
Fang-Oosterlee Option Pricing for Rust
Implements Fang-Oosterlee option pricing in Rust. Documentation is at docs.rs
Use
The crate is available on crates.io.
Import and use:
extern crate num_complex;
use Complex;
extern crate fang_oost_option;
use option_pricing;
let num_u:usize = 256;
let asset = 50.0;
let strikes = vec!;
let rate = 0.03;
let t_maturity = 0.5;
let volatility:f64 = 0.3;
//As an example, cf is standard diffusion
let cf = ;
let prices = fang_oost_call_price;
Speed
The benchmarks are comparable to my C++ implementation. To run the tests with benchmarking, use cargo bench
. You can see the benchmarks at https://phillyfan1138.github.io/fang_oost_option_rust/report/index.html.