Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong output from lngamma #1

Open
wandonye opened this issue Sep 22, 2021 · 0 comments
Open

Wrong output from lngamma #1

wandonye opened this issue Sep 22, 2021 · 0 comments

Comments

@wandonye
Copy link

The approximation for lngamma(9.0) is not 10.64917311666183

According to wolframalpha
https://www.wolframalpha.com/input/?i=lngamma%289.0%29
the right approximation should be
gammaln(9.0) = 10.60460290274525

This is due to a bug in this line:

for i in (0..<Array.pLn.count - 1).reversed() {

for i in (0..<Array.pLn.count - 1).reversed() {

should be

for i in (1..<Array.pLn.count ).reversed() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant