Skip to main content

compute_iv_and_greeks

Function compute_iv_and_greeks 

Source
pub fn compute_iv_and_greeks<T: BlackScholesReal>(
    mkt_price: T,
    s: T,
    k: T,
    t: T,
    r: T,
    b: T,
    is_call: T::Mask,
    initial_guess: T,
) -> Greeks<T>
Expand description

Performs a single Halley iteration to refine an implied volatility estimate and compute greeks.

§Important Notes

This function is intended as a refinement step when a good initial guess for volatility is available (e.g., from a previous calculation or a fast approximation). It performs only a single Halley iteration and does not implement a full convergence loop.

This is NOT a standalone implied volatility solver. For production use, prefer imply_vol_and_greeks which uses the robust implied_vol crate for full convergence.

§Parameters

  • initial_guess: Must be a reasonable estimate of the true volatility. Poor initial guesses (especially for deep ITM/OTM options) may result in significant errors.

§Accuracy

With a good initial guess (within ~25% of true vol), one Halley step typically achieves ~1% relative error. For deep ITM/OTM options or poor initial guesses, multiple iterations or a better initial estimate may be required.