Skip to main content

imply_vol_and_greeks_checked

Function imply_vol_and_greeks_checked 

Source
pub fn imply_vol_and_greeks_checked(
    s: f64,
    r: f64,
    b: f64,
    is_call: bool,
    k: f64,
    t: f64,
    price: f64,
    db_dr: f64,
    initial_vol: Option<f64>,
) -> Result<BlackScholesGreeksResult, OptionValuationError>
Expand description

Solves implied volatility and computes validated Greeks with explicit carry rate sensitivity.

A refinement seed is used only when it produces an interior volatility and reprices the premium within 0.01 percent, otherwise the full implied-volatility solver is used. The exact implementation is used when the fast kernel cannot reprice the solved premium within that tolerance. Carry rate sensitivity and rho units follow black_scholes_greeks_checked.

ยงErrors

Returns an error if:

  • Model inputs or the premium are invalid.
  • The premium has no finite positive implied volatility.
  • Results are nonfinite, inconsistent, or fail the 0.01 percent repricing tolerance.