class SsviVolatilityFunction extends VolatilityFunctionProvider<SsviFormulaData> implements ImmutableBean, Serializable {

  @Override
  public double volatility(double forward, double strike, double timeToExpiry, SsviFormulaData data) {
    ArgChecker.isTrue(timeToExpiry > MIN_TIME_TO_EXPIRY, "time to expiry must not be zero to be able to compute volatility");
    double volatilityAtm = data.getSigma();
    double rho = data.getRho();
    double eta = data.getEta();
    double theta = volatilityAtm * volatilityAtm * timeToExpiry;
    double phi = eta / Math.sqrt(theta);
    double k = Math.log(strike / forward);
    double w = 0.5 * theta * (1.0d + rho * phi * k + Math.sqrt(1.0d + 2 * rho * phi * k + phi * k * phi * k));
    return Math.sqrt(w / timeToExpiry);
  }

  private  SsviVolatilityFunction();

}