You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Xi Chen (Jira)" <ji...@apache.org> on 2019/09/02 10:00:14 UTC

[jira] [Created] (MATH-1496) An error in Gamma.java

Xi Chen created MATH-1496:
-----------------------------

             Summary: An error in Gamma.java
                 Key: MATH-1496
                 URL: https://issues.apache.org/jira/browse/MATH-1496
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 3.6.1
            Reporter: Xi Chen


457   if (x >= C_LIMIT) {
458       // use method 4 (accurate to O(1/x^8)
459       double inv = 1 / (x * x);
460       //                     1            1                   1                 1
461       // log(x)  -  -----  -  ----------  +  ------------  -  ------------
462       //                   2 x     12 x^2      120 x^4     252 x^6
463       return FastMath.log(x) - 0.5 / x - inv * ((1.0 / 12) + inv * (1.0 / 120 - inv / 252));
464   }

Line 463:
return FastMath.log(x) - 0.5 / x - inv * ((1.0 / 12) + inv * (1.0 / 120 - inv / 252));

Is it should be:
return FastMath.log(x) - 0.5 / x - inv * ((1.0 / 12) - inv * (1.0 / 120 - inv / 252));



--
This message was sent by Atlassian Jira
(v8.3.2#803003)