2

(Hobbyist here, please excuse any misunderstanding I have below.)

I'm trying to compute values of the Riemann zeta function in the critical strip, using the Dirichlet eta function. I've reimplemented this implementation in C. I get the same values as the reference implementation, so I'm pretty sure the implementation is correct.

The values look correct on the critical line, but the errors get quite large when approaching the ends of the critical strip. Is this expected? If so, is there a different formula I could implement that shows smaller errors around the end of the strip?

Thank you!

  • I was afraid I'd get that answer. To me it seems like the code is correct, so I was looking for an answer for whether the large errors come naturally from the formula near the critical strip's ends. I should have phrased it differently, but I still think the question is relevant here. – balidani Apr 04 '17 at 05:44
  • If you can translate that code into a mathematical formula of what it's computing, and post that code into your question (along with some specific points at which you're trying to compute it), I bet we could help you. – Greg Martin Apr 04 '17 at 06:11
  • $$ \zeta(s) \approx \sum_{1}^{N}\dfrac{(n^{-s} * (-1)^{n - 1})}{2^{1-s}-1} $$

    This looks just like the Dirichlet eta function when I check Wikipedia, but the errors are large. For example $$ \zeta(0.1+14.5i) $$ is (0.27 - 0.37i) instead of (-0.40 + 0.34i) for an N of 10000. On the critical line it's "much" better, with an error under 1%

    – balidani Apr 04 '17 at 06:37
  • This was the "zeta2" function from the code I linked by the way. Meanwhile I found that the "zeta3" function is equation #21 in this article. This provides much better results near 0 and 1. – balidani Apr 04 '17 at 08:49
  • 1
    @TheGreatDuck This is a math problem. – reuns Apr 04 '17 at 11:09

1 Answers1

1

You should compute an upper bound for the error.

For $Re(s) > 0$ : $$\eta(s) = \sum_{n=1}^\infty (-1)^{n+1}n^{-s}=\sum_{n=1}^\infty (2n-1)^{-s}-(2n)^{-s} = \sum_{n=1}^\infty \int_{2n-1}^{2n}s x^{-s-1}dx$$ $$\left|\eta(s)-\sum_{n=1}^{2N} (-1)^{n+1} n^{-s}\right| \le \sum_{n=N+1}^\infty \int_{2n-1}^{2n} |s x^{-s-1}|dx\\<|s| \int_{2N+1}^\infty x^{-Re(s)-1}dx=\frac{|s|}{Re(s)}(2N+1)^{-Re(s)}$$ Which suggests that for a fixed $N$, the error increases as $Im(s)$ gets large or $Re(s) \to 0$


See this post if you want a fast converging series valid for every $s$ $$\eta(s)=\sum_{n=0}^\infty \frac{1}{2^{n+1}} \sum_{k=0}^n (-1)^{k} {n \choose k} \frac {1}{(k+1)^s}$$

reuns
  • 77,999
  • @balidani Can you add this error bound to your program or better to the one in javascript ? – reuns Apr 04 '17 at 14:14
  • The JavaScript code is not mine and it's only a snippet. I can add a comment on that page so if anyone needs this info they can find it. I'll use the converging series in my code.

    PS: I was amused by this quote about the series: "conjectured by Knopp around 1930, proved by Hasse (1930), and rediscovered by Sondow (1994)"

    – balidani Apr 04 '17 at 14:23
  • @balidani see there I added the bound and form code (use the debugger : f12) – reuns Apr 04 '17 at 14:49