BlackFormulaRepository { @ExternalFunction public static double volga(final double forward, final double strike, final double timeToExpiry, final double lognormalVol) { return vomma(forward, strike, timeToExpiry, lognormalVol); }  @ExternalFunction static double price(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol, final boolean isCall); static double price(final SimpleOptionData data, final double lognormalVol); static double price(final SimpleOptionData[] data, final double lognormalVol); @ExternalFunction static double delta(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol, final boolean isCall); static double strikeForDelta(final double forward, final double forwardDelta, final double timeToExpiry,
      final double lognormalVol, final boolean isCall); @ExternalFunction static double dualDelta(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol, final boolean isCall); @ExternalFunction static double simpleDelta(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol, final boolean isCall); @ExternalFunction static double gamma(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol); @ExternalFunction static double dualGamma(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol); @ExternalFunction static double crossGamma(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol); @ExternalFunction static double theta(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol, final boolean isCall, final double interestRate); @ExternalFunction static double thetaMod(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol, final boolean isCall, final double interestRate); @ExternalFunction static double driftlessTheta(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol); @ExternalFunction static double vega(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol); @ExternalFunction static double vega(final SimpleOptionData data, final double lognormalVol); @ExternalFunction static double vanna(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol); @ExternalFunction static double dualVanna(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol); @ExternalFunction static double vomma(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol); @ExternalFunction static double volga(final double forward, final double strike, final double timeToExpiry,
      final double lognormalVol); static double impliedVolatility(final double price, final double forward, final double strike,
      final double timeToExpiry, final boolean isCall); @ExternalFunction static double impliedVolatility(final double otmPrice, final double forward, final double strike,
      final double timeToExpiry, final double volGuess); static double impliedVolatility(final SimpleOptionData data, final double price); static double impliedVolatility(final SimpleOptionData[] data, final double price); @ExternalFunction static double impliedStrike(final double delta, final boolean isCall, final double forward, final double time,
      final double volatility); static double impliedStrike(final double delta, final boolean isCall, final double forward, final double time,
      final double volatility, final double[] derivatives);  }
@Test public void volgaTest() { final int nStrikes = STRIKES_INPUT.length; final int nVols = VOLS.length; for (int i = 0; i < nStrikes; ++i) { for (int j = 0; j < nVols; ++j) { final double strike = STRIKES_INPUT[i]; final double vol = VOLS[j]; final double volga = BlackFormulaRepository.volga(FORWARD, strike, TIME_TO_EXPIRY, vol); final double vomma = BlackFormulaRepository.vomma(strike, FORWARD, TIME_TO_EXPIRY, vol); assertEquals(vomma, volga, Math.abs(vomma) * 1.e-8); } } }