throw new OpenGammaRuntimeException("Unexpected InstrumentDerivative type");
}
final double spot = market.getForwardCurve().getSpot();
final double discountRate = market.getDiscountCurve().getInterestRate(timeToExpiry);
final double costOfCarry = discountRate - Math.log(market.getForwardCurve().getForward(timeToExpiry) / spot) / timeToExpiry;
final double impliedVol = (new BaroneAdesiWhaleyModel()).impliedVolatility(optionPrice, spot, strike, discountRate, costOfCarry, timeToExpiry, isCall);
final ValueSpecification resultSpec = new ValueSpecification(getValueRequirementNames()[0], targetSpec, resultProperties);
return Collections.singleton(new ComputedValue(resultSpec, impliedVol));
}