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