Combinatorics.jl
Combinatorics.jl copied to clipboard
Double factorial can be extended to negative ints
The following error may be averted, or such functionality made possible with an additional method:
https://github.com/JuliaMath/Combinatorics.jl/blob/c2114a71ccfc93052efb9a9379e62b81b9388ef8/src/factorials.jl#L47-L54
An example of how ‼︎ can be extended to the signed integers is found on Wikipedia at Ellipse § Circumference:
where $n‼︎$ is the double factorial (extended to negative odd integers
by the recurrence relation $(2n-1)‼︎ = (2n+1)‼︎ / (2n+1)$, for $n ≤ 0$).
Would this be a useful addition to the library? Alternatively, if there are multiple distinct analytical continuations of ‼︎ for the negative integers, could I have a lead for how to implement it in Julia? Would this issue be a better fit for the SpecialFunctions library?