|
| double | norm_pdf (double x) noexcept |
| | Standard normal density and distribution. erfc keeps the far tail accurate (no 1 - N(x)).
|
| |
| double | norm_cdf (double x) noexcept |
| |
| constexpr double | year_fraction (std::int64_t expiry_ns, std::int64_t now_ns) noexcept |
| | Year fraction between two epoch-ns timestamps (ACT/365); negative once expired.
|
| |
| Greeks | black76 (CallPut cp, double forward, double strike, double t_years, double sigma, double rate=0.0) noexcept |
| | Price and greeks.
|
| |
| double | black76_price (CallPut cp, double forward, double strike, double t_years, double sigma, double rate=0.0) noexcept |
| |
| IvResult | implied_vol (CallPut cp, double price, double forward, double strike, double t_years, double rate=0.0, double price_tol=1e-12, int max_iterations=100) noexcept |
| | Implied volatility of a Black-76 price.
|
| |
| double | to_coin_price (double quote_value, double forward) noexcept |
| | Quote-currency value -> price in the base coin (Deribit BTC options: USD / underlying price).
|
| |
| constexpr double | coin_delta (double delta, double coin_price) noexcept |
| | Delta of a coin-quoted option in coin units.
|
| |
| IvResult fastmm::options::implied_vol |
( |
CallPut |
cp, |
|
|
double |
price, |
|
|
double |
forward, |
|
|
double |
strike, |
|
|
double |
t_years, |
|
|
double |
rate = 0.0, |
|
|
double |
price_tol = 1e-12, |
|
|
int |
max_iterations = 100 |
|
) |
| |
|
inlinenoexcept |
Implied volatility of a Black-76 price.
price_tol is the absolute price tolerance (same unit as price); iterations never exceed max_iterations.
Work undiscounted: the bounds are then [max(F-K, 0), F] for calls, [max(K-F, 0), K] for puts.
Brenner-Subrahmanyam start (exact at the money), kept inside the bracket.
Newton left the bracket (or produced NaN): bisect.