class BlackFormulaRepository {

  public static double impliedVolatilityFromNormalApproximated2(
      double forward,
      double strike,
      double timeToExpiry,
      double normalVolatility) {
    ArgChecker.isTrue(strike > 0, "strike must be strctly positive");
    ArgChecker.isTrue(forward > 0, "strike must be strctly positive");
    double lnFK = Math.log(forward / strike);
    double s2t = normalVolatility * normalVolatility * timeToExpiry;
    if (Math.abs((forward - strike) / strike) < ATM_LIMIT) {
      double factor1 = 1.0d / Math.sqrt(forward * strike);
      double factor2 = (1.0d + s2t / (24.0d * forward * strike)) / (1.0d + lnFK * lnFK / 24.0d);
      return normalVolatility * factor1 * factor2;
    }
    double factor1 = lnFK / (forward - strike);
    double factor2 = (1.0d + (1.0d - lnFK * lnFK / 120.0d) * s2t / (24.0d * forward * strike));
    return normalVolatility * factor1 * factor2;
  }

  private  BlackFormulaRepository();

}