You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var f_gamma = function f_gamma(n) {
//unrelated things
var l = 0.9189385332046727; //0.5*Math.log(2*Math.PI)
l = l + (n + 0.5) * Math.log(n);
l = l - n;
var n2 = n * n;
var np = n;
l = l + 1 / (12 * np);
np = np * n2;
l = l + 1 / (360 * np);
np = np * n2;
l = l + 1 / (1260 * np);
np = np * n2;
l = l + 1 / (1680 * np);
np = np * n2;
l = l + 1 / (1188 * np);
np = np * n2;
l = l + 691 / (360360 * np);
np = np * n2;
l = l + 7 / (1092 * np);
np = np * n2;
l = l + 3617 / (122400 * np);
return Math.exp(l) / scal1;
};
This looks like the series expansion of ln(n!), but some coefficients are wrong:
The l = l + 1 / (360 * np); should be l = l - 1 / (360 * np);
The l = l + 1 / (1680 * np); should be l = l - 1 / (1680 * np);
The l = l + 691 / (360360 * np); should be l = l - 691 / (360360 * np);
The l = l + 3617 / (122400 * np); should be l = l - 3617 / (122400 * np);
I guess the mistake also exists in other files than break_eternity.js
The text was updated successfully, but these errors were encountered:
This looks like the series expansion of ln(n!), but some coefficients are wrong:
The
l = l + 1 / (360 * np);
should bel = l - 1 / (360 * np);
The
l = l + 1 / (1680 * np);
should bel = l - 1 / (1680 * np);
The
l = l + 691 / (360360 * np);
should bel = l - 691 / (360360 * np);
The
l = l + 3617 / (122400 * np);
should bel = l - 3617 / (122400 * np);
I guess the mistake also exists in other files than
break_eternity.js
The text was updated successfully, but these errors were encountered: