Style fixes and performance improvement.
@@ -70,6 +70,6 @@ public class SwaptionATM extends AbstractLIBORMonteCarloProduct {
* @return The Bachelier implied volatility.
*/
public RandomVariableInterface getImpliedBachelierATMOptionVolatility(RandomVariableInterface optionValue, double optionMaturity, double swapAnnuity){
- return optionValue.average().div(Math.sqrt(optionMaturity / Math.PI / 2.0)).div(swapAnnuity);
+ return optionValue.average().mult(Math.sqrt(2.0 * Math.PI / optionMaturity) / swapAnnuity);
}
}
