implied-vol 2.0.0

A pure rust implementation of Peter Jäckel's implied volatility calculation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub trait MulAdd {
    fn mul_add2(self, a: f64, b: f64) -> f64;
}

impl MulAdd for f64 {
    #[cfg(not(feature = "fma"))]
    #[inline(always)]
    fn mul_add2(self, a: f64, b: f64) -> f64 {
        a * self + b
    }

    #[cfg(feature = "fma")]
    #[inline(always)]
    fn mul_add2(self, a: f64, b: f64) -> f64 {
        self.mul_add(a, b)
    }
}