You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (Jira)" <ji...@apache.org> on 2019/09/02 10:45:00 UTC
[jira] [Commented] (MATH-1496) An error in Gamma.java
[ https://issues.apache.org/jira/browse/MATH-1496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16920769#comment-16920769 ]
Gilles commented on MATH-1496:
------------------------------
Thanks for th report.
You are quite right; but this has already been [fixed|https://gitbox.apache.org/repos/asf?p=commons-numbers.git;a=commit;h=14f6f851b179249cb74b6dfa5b3c8d193e607186] in the new ["Commons Numbers"|http://commons.apache.org/proper/commons-numbers/] project into which the [Gamma functionality has been moved|https://gitbox.apache.org/repos/asf?p=commons-numbers.git;a=tree;f=commons-numbers-gamma].
> 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
>
> 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)