-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lerch transcendental function #371
Comments
A few relevant papers: https://carma.newcastle.edu.au/resources/jon/lerch.pdf https://gnpalencia.org/research/GNP_Lerch_2018.pdf https://arxiv.org/pdf/1005.4967.pdf A general method to compute phi(z,s,a) is to use recurrence relations to ensure Re(a) >= 1 and then evaluate the Hermite integral representation by direct numerical integration. I would maybe start with this and then add various series expansions and Euler-Maclaurin summation where applicable to speed up common cases. |
I believe Algorithm 3 in https://carma.newcastle.edu.au/resources/jon/lerch.pdf should be usable as a general solution.
This needs a bit of work to turn into a complete algorithm, though, and it needs some branch cut fix for z in [0, inf). |
Seems good, but the error term of it seems daunting to compute (perhaps you have some deeper knowledge in the error term of the gamma function). And I can't seem to find the rate of convergence, do you happen to know how fast it should converge? |
Gamma(a,z) converges like exp(-z) when z goes to +infinity, so the convergence is quite strong; we only need O(sqrt(prec)) terms. For real positive z with z > Re(a), it is possible to use a bound like |Gamma(a,z)| <= max(1, 2^Re(a)) z^(Re(a)-1) exp(-z). We would also need complex z here, and then things get a bit more complicated. The formulas in https://dlmf.nist.gov/13.7#ii are a possible starting point. I've recently been working on a restricted version of this for Dirichlet L-functions; I should have some time to look at Lerch when I'm done with that. |
There is now a first implementation in 1abaf57 using direct summation for |z| << 1 and the Hankel contour integral for the analytic continuation. Numerical integration isn't the fastest but it should at least work as a fallback and as a comparison baseline for more efficient methods. |
Is that with correct error bounds? If so, can you share the proofs for those error bounds used? |
Yes. I'm going to write things down somewhere. |
I put it on my blog: https://fredrikj.net/blog/2022/02/computing-the-lerch-transcendent/ |
Truly great work!! |
I know how to efficiently calculate Lerch transcendental function for integer
s \le 1
(maybe fors = 2
as well) when|x| < 1
and as well as whenx
is a root of unity. If someone knows how to efficiently calculate the rest of the cases, it might be worthwhile to implement the function.Edit: Seems to be easy to calculate for positive integers
s
.The text was updated successfully, but these errors were encountered: