Skip to content

Commit

Permalink
bug fix to polygamma for order > 1, found by @andreasnoackjensen in #…
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Jun 3, 2014
1 parent b80f270 commit 4ba3b7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/special/gamma.jl
Expand Up @@ -308,7 +308,7 @@ function psifn(x::Float64, n::Int, kode::Int, m::Int)
ans[1] = s - log(xq)
return ans
end
polygamma(k::Int, x::Float64) = (2rem(k,2) - 1)*psifn(x, k, 1, 1)[1]/gamma(k + 1)
polygamma(k::Int, x::Float64) = (2rem(k,2) - 1)*psifn(x, k, 1, 1)[1]*gamma(k + 1)
polygamma(k::Int, x::Float32) = float32(polygamma(k, float64(x)))
polygamma(k::Int, x::Real) = polygamma(k, float64(x))

Expand Down

2 comments on commit 4ba3b7b

@JeffBezanson
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use a test for this.

@stevengj
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test in commit 0b7bc72

Please sign in to comment.