/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/EuropeanOptionVegaPathwise.java
final double S0 = underlyingAtMaturity.get( path) ;
final double S0 = underlyingAtToday.get ( path ) ;
double average = 0.0; for(int path=0; path<model.getNumberOfPaths(); path++) { if(underlyingAtMaturity.get(path) > strike) { final double T = maturity; <extra_id_0> final double r = blackScholesModel.getModel().getRiskFreeRate().doubleValue(); final double sigma = blackScholesModel.getModel().getVolatility().doubleValue(); final double ST = underlyingAtMaturity.get(path); final double WT = (Math.log(ST/S0) - r * T + 0.5 * sigma * sigma * T)/sigma; final double modifiedPayoff = ST * (-sigma * T + WT); average += modifiedPayoff / numeraireAtMaturity.get(path) * monteCarloWeights.get(path) * numeraireAtToday.get(path);