Post Reply 
Riemann's Zeta Function - another approach (RPL)
08-02-2017, 11:19 AM (This post was last modified: 08-02-2017 11:51 AM by Dieter.)
Post: #76
RE: Riemann's Zeta Function - another approach (RPL)
(08-01-2017 04:54 PM)Gerson W. Barbosa Wrote:  I remember I had to hard-code Zeta(0) = -1/2 here (line 116).

The problem is any x sufficiently close to zero as 1–x may round to 1. This also seems to be a problem on the WP34s, cf. my post in the other forum. Here the polynomial approximation that goes down to x=0 has an advantage.

In the meantime I have looked at the required number of terms for the iterative method (x>2). With about 400/x² + 10 terms the remaining error is roughly 2 units in the 13th digit which is as good as the best of the polynomial approximations. But this requires more than 100 terms. Then I found another quite effective method that requires less terms: n = 2*int(100/x^1,5 + 5) uses merely 80 terms at x=2 and has an error that can be easily compensated with a simple formula: for x<4 subtract 4,4 E–12*(4–x) from the final result. This should limit the error to less than ±1 unit in the 13th digit. And the correction can be done in just 7 steps.

This can also be done for 10-digit accuracy, e.g. the HP-41 version. Here one may use n = 2*int(22/x + 4) terms and decrease the result for x<3 by 5 E–10*(3–x). This should limit the error to about one unit in the 11th digit, mostly even less. At least that's what can be achieved with sufficient arithmetic precision. On a physical HP-41 or a true emulator this does not make any difference as the correction is always less than 5 E–10 in a result >1. ;-) But I will change the number of terms to 2*int(24/x+3) and remove the limitation to n=22.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Riemann's Zeta Function - another approach (RPL) - Dieter - 08-02-2017 11:19 AM



User(s) browsing this thread: 1 Guest(s)