JuliaMath / JuliaMath/SpecialFunctions.jl

`zeta(0, x), zeta(s, -1)` gives wrong answer

Open
#496 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
381
Forks
113
Avg merge
1d 23h
Merged PRs (30d)
1

Description

We have: `zeta(0, x) = 0.5 - x`
Ref: https://en.wikipedia.org/wiki/Hurwitz_zeta_function#Negative_integers

But SpecialFunctions v2.5.1 gives:
```jl
julia> [ zeta(0, n) for n in 1:3 ] # look good
3-element Vector{Float64}:
-0.5
-1.5
-2.5

julia> [ zeta(0, -n) for n in 1:3 ]
3-element Vector{Float64}:
0.5
1.5
2.5

julia> [ 0.5+n for n in 1:3 ]
3-element Vector{Float64}:
1.5
2.5
3.5
```

And Wolfram gives:
```wolfram
In[2]:= Zeta[0, -1]
Out[2]= 3/2
In[3]:= Zeta[0, -2]
Out[3]= 5/2
In[4]:= Zeta[0, -3]
Out[4]= 7/2
```

-----

## Special values

Test with: `zeta(s, -1) == 1 + zeta(s)`
ref: https://reference.wolfram.com/language/ref/Zeta.html#479430652

```jl
julia> zeta(-9, -1)
-1.0075757575757576

julia> zeta(-7, -1)
-0.9958333333333333

julia> zeta(-6, -1)
NaN

julia> zeta(2, -1)
Inf
```

Wolfram:
```wolfram
In[10]:= Zeta[-9, -1]
Out[10]= 131/132
In[11]:= Zeta[-7, -1]
Out[11]= 241/240
In[12]:= Zeta[-6, -1]
Out[12]= 1
In[13]:= Zeta[2, -1]
Out[13]= 1+\[Pi]^2/6
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.