Riemann's Zeta Function - another approach (RPL)
|
06-30-2017, 04:50 PM
(This post was last modified: 07-01-2017 09:30 AM by Dieter.)
Post: #28
|
|||
|
|||
RE: Riemann's Zeta Function - another approach (RPL)
(06-30-2017 11:06 AM)Gerson W. Barbosa Wrote: I tested one by one with ever higher n until I got all 10 significant digits right. LOL – I did the same with Excel (VBA) and 15-digit precision, with a threshold of 0,5 ULP compared to the (more or less) exact result with 200 terms. I now have slightly modified the estimate for the required number of terms, see below. (06-30-2017 11:06 AM)Gerson W. Barbosa Wrote: Do you intend to write a full range HP-41 version? I'll be traveling the next few days and I won't take any 41 along. It seems that this would require some kind of Gamma routine, yes? (06-30-2017 11:06 AM)Gerson W. Barbosa Wrote: Thanks again for your great contributions, especially for your striving to always get as many significant digits as possible. While we're at it: I just looked at JMB's routines and found two interesting things: first, in the Borwein program he uses the same e^x–1 method as my own program, and the other version has is a nice trick for evaluating series' with alternating signs. Finally I now got a good approximation for x between 1 and 1,05 (!) which (sufficient precision provided) is within ±0,2 ULP of 10 digits: Zeta(x) ~ 1/u + u/(0,9246 · u + 13,733) + 0,577215654 where u = x–1 All this leads to the following new and improved version: Code: 01 LBL"ZETA" Again, this works for x > 1. Addendum for the 15C and others: The benefit of the e^x–1 method for the resulting accuracy can also be achieved in another way. 2x/(2x–2) – 1 = 1/(2x–1–1) Edit: not sure if this is a good idea for x close to 1 – see further below for an ex–1 implementation on the 15C. So the final multiplication with this power-of-2-fraction can also be coded like this (assuming –x is stored in R1, as in your 15C program): Code: ... Edit: Finally, here is a 15C version. Please also note the alternative solution with an ex–1 implementation a few posts below. Code: # -------------------------------------------- Hint: replaced the strange "+" and "x" characters generated by the emulator with more common ones. Hint2: the emulator's extended precision is great, but it seems to use binary arithmetics: enter x=1,05 and the x>y? test that compares x–1 with 0,05 tests true (!) and jumps to LBL 0. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)