Skip to content

Commit

Permalink
Fix bug in incompleteGamma
Browse files Browse the repository at this point in the history
Approximation for case s>1000 was calculated wrongly.
  • Loading branch information
Shimuuar committed Jan 22, 2012
1 parent f2420c2 commit cd0f039
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Numeric/SpecFunctions.hs
Expand Up @@ -178,7 +178,7 @@ incompleteGamma p x
| otherwise = let g = p * log x - x - logGamma p + log cf
in if g > limit then 1 - exp g else 1
where
norm a = erfc (- a / m_sqrt_2)
norm a = 0.5 * erfc (- a / m_sqrt_2)
pearson !a !c !g
| c' <= tolerance = g'
| otherwise = pearson a' c' g'
Expand Down

0 comments on commit cd0f039

Please sign in to comment.