if (f.isUp()) {
fail("implied volatility calculation triggered a change in another instrument");
}
option2.recalculate();
if (Math.abs(option2.NPV() - refValue) >= 1.0e-8) {
fail("implied volatility calculation changed the value "
+ "of another instrument: \n"
+ "previous value: " + refValue + "\n"
+ "current value: " + option2.NPV());