/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/EuropeanOptionGammaLikelihood.java
final double x = 1.0 / ( sigma * Math.sqrt( T) ) * ( Math.log( ST) - ( phi * T - 0.5 * sigma*sigma * T + Math.log( S0) ) ) ;
final double x = 1.0 / ( sigma * Math.sqrt ( T ) ) * ( Math.log ( ST ) - ( r * T - 0.5 * sigma*sigma * T + Math.log ( S0 ) ) ) ;
final double r = blackScholesModel.getModel().getRiskFreeRate().doubleValue(); final double sigma = blackScholesModel.getModel().getVolatility().doubleValue(); final double ST = underlyingAtMaturity.get(path); double lr; if(isLikelihoodByFiniteDifference) { final double h = 1E-2; <extra_id_0> final double phi = (1.0/Math.sqrt(2 * Math.PI) * Math.exp(-x*x/2.0) / (ST * (sigma) * Math.sqrt(T)) ); final double xDown = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0-h))); final double phiDown = (1.0/Math.sqrt(2 * Math.PI) * Math.exp(-xDown*xDown/2.0) / (ST * (sigma) * Math.sqrt(T)) ); final double xUp = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0+h))); final double phiUp = (1.0/Math.sqrt(2 * Math.PI) * Math.exp(-xUp*xUp/2.0) / (ST * (sigma) * Math.sqrt(T)) ); lr = (phiUp - 2 * phi + phiDown) / (h * h) / phi;