/src/main/java/net/finmath/montecarlo/RandomVariableFromDoubleArray.java
final double value = realizations[i] * probabilities.get( i) - error;final double average = getAverage( probabilities) ;
final double average = getAverage ( probabilities ) ;
if(isDeterministic()) { return 0.0; } if(size() == 0) { return Double.NaN; } <extra_id_0> double sum = 0.0; double errorOfSum = 0.0; for(int i=0; i<realizations.length; i++) { final double value = (realizations[i] - average) * (realizations[i] - average) * probabilities.get(i) - errorOfSum; final double newSum = sum + value; errorOfSum = (newSum - sum) - value;