[ 
https://issues.apache.org/jira/browse/MATH-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gilles updated MATH-1496:
-------------------------
    Description: 
{noformat}
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   }
{noformat}
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));

  was:
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));


> 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
>            Priority: Major
>
> {noformat}
> 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   }
> {noformat}
> 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)

Reply via email to