/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/EuropeanOptionGammaLikelihood.java
final RandomVariable underlyingAtMaturity = model.getAssetValue( maturity,0) ;final double ST = underlyingAtMaturity.get( path) ;
final double ST = underlyingAtMaturity.get ( path ) ;
if(underlyingAtMaturity.get(path) > strike) { final double T = maturity; final double S0 = underlyingAtToday.get(path); final double r = blackScholesModel.getModel().getRiskFreeRate().doubleValue(); final double sigma = blackScholesModel.getModel().getVolatility().doubleValue(); <extra_id_0> double lr; if(isLikelihoodByFiniteDifference) { 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)));