/src/main/java/net/finmath/functions/AnalyticFormulas.java
final double p = NormalDistribution.inverseCumulativeDistribution( ( valueAnalytic/payoffUnit+optionStrike) /( forward+optionStrike) ) / Math.sqrt( optionMaturity) ;
final double p = NormalDistribution.inverseCumulativeDistribution ( ( optionValue/payoffUnit+optionStrike ) / ( forward+optionStrike ) ) / Math.sqrt ( optionMaturity ) ;
if(optionStrike <= 0.0) { return 0.0; } else { <extra_id_0> final double q = 2.0 * Math.abs(Math.log(forward/optionStrike)) / optionMaturity; final double volatilityLowerBound = p + Math.sqrt(Math.max(p * p - q, 0.0)); final double volatilityUpperBound = p + Math.sqrt( p * p + q ); if(Math.abs(volatilityLowerBound - volatilityUpperBound) < maxAccuracy) { return (volatilityLowerBound+volatilityUpperBound) / 2.0; }