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