Riemann's Zeta Function - another approach (RPL)
|
08-08-2017, 06:46 PM
(This post was last modified: 08-08-2017 06:58 PM by Dieter.)
Post: #83
|
|||
|
|||
RE: Riemann's Zeta Function - another approach (RPL)
(08-08-2017 04:05 AM)Gerson W. Barbosa Wrote: Very nice! Wait, it even gets a tiny bit nicer. ;-) (08-08-2017 04:05 AM)Gerson W. Barbosa Wrote: I would only make a minor modification. Not that one less square root evaluation really might make a difference in execution time in Free42: Ah, great. It's not beause of the sqrt, but I love this elegant stack content reuse of the 0.5 that still sits in T. ;-) But there even is one more tweak. The second term of the Zeta Taylor series is quite exactly –x², i.e. \(\zeta(x)\ \approx -(0.5+x^2+x\cdot\ln\sqrt{2 \pi})\). And this can be implemented with just one more step: Code: … This way the threshold in line 08 should be somewhere near 1 E–8. The perfect value differs slightly for negative resp. positive x, but 8 E–9 works very nicely for both. BTW, if you want to stick to the original implementation the perfect switchpoint seems to be close to 2 E–11, so this value should be used there. I edited my original post accordingly. But we're talking about differences beyond the 20th digit here. ;-) Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)