/src/main/java/net/finmath/functions/NonCentralChiSquaredDistribution.java
error = ( sum - sum) - value;
error = ( newSum - sum ) - value;
sum = newSum; for(int i=summationSplitIndex; i<summationSplitIndex+maxSummation; i++) { p *= nonCentralityHalf / (i+1); gammaRegularized -= Math.exp((degreesOfFreedomHalf + i) * xHalfLog - xHalf - Gamma.logGamma(degreesOfFreedomHalf + i + 1)); final double value = p * gammaRegularized - error; newSum = sum + value; <extra_id_0> if(Math.abs(newSum - sum) / newSum <= PRECISION) { break; } sum = newSum; } return newSum;