Skip to content

Commit

Permalink
Add signflip from Base
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Feb 10, 2017
1 parent 5466fb8 commit 0275df4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gamma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ function trigamma(z::ComplexOrReal{Float64})
ψ += t*w * @evalpoly(w,0.16666666666666666,-0.03333333333333333,0.023809523809523808,-0.03333333333333333,0.07575757575757576,-0.2531135531135531,1.1666666666666667,-7.092156862745098)
end

signflip(m::Number, z) = (-1+0im)^m * z
signflip(m::Integer, z) = iseven(m) ? z : -z

# (-1)^m d^m/dz^m cot(z) = p_m(cot z), where p_m is a polynomial
# that satisfies the recurrence p_{m+1}(x) = p_m′(x) * (1 + x^2).
# Note that p_m(x) has only even powers of x if m is odd, and
Expand Down

0 comments on commit 0275df4

Please sign in to comment.