/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/EuropeanOptionGammaLikelihood.java
} lr = d2PhidS02 / phi;
lr = d2PhidS02 / phi; }
else { 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 dPhidS0 = x / (sigma * Math.sqrt(T)) / S0 * phi; final double d2PhidS02 = -1 / (sigma * Math.sqrt(T)) / (sigma * Math.sqrt(T)) / S0 / S0 * phi - x / (sigma * Math.sqrt(T)) / S0 / S0 * phi + x / (sigma * Math.sqrt(T)) / S0 * dPhidS0; <extra_id_0> final double payOff = (underlyingAtMaturity.get(path) - strike); final double modifiedPayoff = payOff * lr; average += modifiedPayoff / numeraireAtMaturity.get(path) * monteCarloWeights.get(path) * numeraireAtToday.get(path); } } return average;