SmileDeltaParameters { public double[] getStrike(final double forward) { final int nbDelta = _delta.length; final double[] strike = new double[2 * nbDelta + 1]; strike[nbDelta] = forward * Math.exp(_volatility[nbDelta] * _volatility[nbDelta] * _timeToExpiry / 2.0); for (int loopdelta = 0; loopdelta < nbDelta; loopdelta++) { strike[loopdelta] = BlackFormulaRepository.impliedStrike(-_delta[loopdelta], false, forward, _timeToExpiry, _volatility[loopdelta]); strike[2 * nbDelta - loopdelta] = BlackFormulaRepository.impliedStrike(_delta[loopdelta], true, forward, _timeToExpiry, _volatility[2 * nbDelta - loopdelta]); } return strike; } SmileDeltaParameters(final double timeToExpiration, final double[] delta, final double[] volatility);  SmileDeltaParameters(final double timeToExpiry, final double atm, final double[] delta, final double[] riskReversal, final double[] strangle); double[] getStrike(final double forward); double getTimeToExpiry(); double[] getDelta(); double[] getVolatility(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(enabled = false) public void performance() { int nbDelta = DELTA.length; long startTime, endTime; final int nbTest = 1000; SmileDeltaParameters[] smile = new SmileDeltaParameters[nbTest]; startTime = System.currentTimeMillis(); for (int looptest = 0; looptest < nbTest; looptest++) { smile[looptest] = new SmileDeltaParameters(TIME_TO_EXPIRY, ATM, DELTA, RISK_REVERSAL, STRANGLE); } endTime = System.currentTimeMillis(); System.out.println(nbTest + " smile from ATM/RR/S in delta term: " + (endTime - startTime) + " ms"); startTime = System.currentTimeMillis(); double[][] strikes = new double[nbTest][2 * nbDelta + 1]; for (int looptest = 0; looptest < nbTest; looptest++) { strikes[looptest] = SMILE.getStrike(FORWARD); } endTime = System.currentTimeMillis(); System.out.println(nbTest + " smile from ATM/RR/S in delta term: " + (endTime - startTime) + " ms"); }