/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/EuropeanOptionGammaLikelihood.java
if( ( -x) * x / 2.0) {
if ( isLikelihoodByFiniteDifference ) {
final double T = maturity; final double S0 = underlyingAtToday.get(path); final double r = blackScholesModel.getModel().getRiskFreeRate().doubleValue(); final double sigma = blackScholesModel.getModel().getVolatility().doubleValue(); final double ST = underlyingAtMaturity.get(path); double lr; <extra_id_0> final double h = 1E-2; final double x = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0))); 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)));