JuliaMath / JuliaMath/SpecialFunctions.jl
Generalized zeta function imprecise for large negative s
- Dominant language
- Julia
- Stars
- 381
- Forks
- 113
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 1
Description
The current implementation of the generalized zeta function $\zeta(s,z)$ suffers from an imprecision for large negative $s$:
~~~.jl
julia> SpecialFunctions.zeta(-100, 2.0)
-1.921642939869165e44
~~~
The correct result should be $-1$, because for negative integer $s$ one would have
$$\zeta(-n,a)=-\frac{B_{n+1}(a)}{n+1}$$
[[Wikipedia](https://en.wikipedia.org/wiki/Hurwitz_zeta_function#Negative_integers)]
For example `Mathematica` gives the correct result:
~~~.wl
In[]:= Zeta[-100, 2] // N[#,17]&
Out[]= -1.0000000000000000
In[]:= -BernoulliB[100 + 1, 2]/(100 + 1)
Out[]= -1
~~~
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.