FLINT3.7.0-dev
Algorithm

Zeta functions, polylogarithms and L-functions

Cost
O(p+∣t∣)O(p + |t|) terms for ζ(s,a)\zeta(s, a) by Euler–Maclaurin summation at precision pp and height tt; O(t)O(\sqrt{t}) by the Riemann–Siegel formula; O(p/log⁡p)O(p/\log p) prime powers for the Euler product at large Re⁡(s)\operatorname{Re}(s).

The Hurwitz zeta function

ζ(s,a)=∑k=0∞1(k+a)s,Re⁡(s)>1,\zeta(s, a) = \sum_{k=0}^\infty \frac{1}{(k+a)^s}, \qquad \operatorname{Re}(s) > 1,

and its analytic continuation to s≠1s \ne 1 are the core of a family of functions: the Riemann zeta function ζ(s)=ζ(s,1)\zeta(s) = \zeta(s, 1), the Dirichlet L-functions, which are linear combinations of Hurwitz zeta values, and the polylogarithms, which are linear combinations of two Hurwitz zeta values with complex parameter. FLINT computes ζ(s,a)\zeta(s, a) and its derivatives with respect to ss by Euler–Maclaurin summation with the rigorous error bounds of [Joh2013], and uses specialised methods where they are faster: exact formulas and the Euler product at integers, the Riemann–Siegel formula high on the critical line (Zeros of the Riemann zeta function), and a Taylor expansion in aa when many values with the same ss are needed.

Overview of methods#

FunctionMethod
acb_dirichlet_zeta, acb_zetaintegers: Bernoulli numbers (negative), arb_zeta_ui (positive); ∣t∣≥24p3/2|t| \ge 24 p^{3/2}: Riemann–Siegel; Re⁡(s)<0\operatorname{Re}(s) < 0: reflection formula; exact dyadic ss at high precision: approximate functional equation; otherwise Euler–Maclaurin
acb_dirichlet_zeta_jetEuler–Maclaurin for any length (reflection for Re⁡(s)≤−4\operatorname{Re}(s) \le -4); Riemann–Siegel for length ≤2\le 2 high on the critical line; exact rational ss of small height at very high precision: approximate functional equation
acb_dirichlet_hurwitz, acb_hurwitz_zetaspecial values (a=1a = 1, s=0s = 0, negative integers via Bernoulli polynomials); otherwise Euler–Maclaurin (_acb_poly_zeta_cpx_series)
arb_zeta_uin>0.7pn > 0.7p: asymptotic; even nn: Bernoulli numbers or Euler product; ζ(3)\zeta(3), ζ(5)\zeta(5): constants; small odd nn at huge precision: Borwein's algorithm by binary splitting; large odd nn: Euler product; otherwise Borwein's algorithm
acb_dirichlet_hurwitz_precomp_evalTaylor expansion in aa on a grid (Taylor expansion in the parameter)
acb_polylog∣z∣<1/2|z| < 1/2: direct series; s=2s = 2: acb_hypgeom_dilog; otherwise two Hurwitz zeta values (Polylogarithms)
acb_dirichlet_lDirichlet L-functions
acb_dirichlet_stieltjesintegral representation [JB2018], or a Hurwitz zeta series at s=1s = 1 (via acb_dirichlet_zeta_jet for a=1a = 1, so with the approximate functional equation at very high precision)

Euler–Maclaurin summation#

Applying the Euler–Maclaurin formula to f(t)=(a+t)−sf(t) = (a + t)^{-s} on [N,∞)[N, \infty) gives the following representation, valid for all s≠1s \ne 1 by analytic continuation.

Theorem 1 (Euler–Maclaurin formula for the Hurwitz zeta function). Let a>0a > 0 be real, N≥0N \ge 0 and M≥1M \ge 1 integers, and s=σ+its = \sigma + it with σ+2M>1\sigma + 2M > 1, s≠1s \ne 1. Then

ζ(s,a)=∑k=0N−11(a+k)s+(a+N)1−ss−1+12(a+N)s+∑j=1MB2j(2j)!(s)2j−1(a+N)s+2j−1+RN,M(s,a),\zeta(s, a) = \sum_{k=0}^{N-1} \frac{1}{(a+k)^s} + \frac{(a+N)^{1-s}}{s-1} + \frac{1}{2 (a+N)^s} + \sum_{j=1}^{M} \frac{B_{2j}}{(2j)!} \frac{(s)_{2j-1}}{(a+N)^{s+2j-1}} + R_{N,M}(s, a),

where (s)k=s(s+1)⋯(s+k−1)(s)_k = s(s+1)\cdots(s+k-1) and

∣RN,M(s,a)∣≤4∣(s)2M∣(2π)2M(a+N)1−σ−2Mσ+2M−1.|R_{N,M}(s, a)| \le \frac{4 |(s)_{2M}|}{(2\pi)^{2M}} \frac{(a+N)^{1-\sigma-2M}}{\sigma + 2M - 1}.

Proof. For σ>1\sigma > 1, the Euler–Maclaurin formula for f(t)=(a+t)−sf(t) = (a+t)^{-s}, whose derivatives are f(m)(t)=(−1)m(s)m(a+t)−s−mf^{(m)}(t) = (-1)^m (s)_m (a+t)^{-s-m}, gives

∑k=N∞f(k)=∫N∞f(t) dt+f(N)2−∑j=1MB2j(2j)!f(2j−1)(N)−∫N∞B~2M(t)(2M)!f(2M)(t) dt,\sum_{k=N}^{\infty} f(k) = \int_N^\infty f(t)\,dt + \frac{f(N)}{2} - \sum_{j=1}^{M} \frac{B_{2j}}{(2j)!} f^{(2j-1)}(N) - \int_N^\infty \frac{\tilde B_{2M}(t)}{(2M)!} f^{(2M)}(t)\,dt,

where B~2M(t)=B2M(t−⌊t⌋)\tilde B_{2M}(t) = B_{2M}(t - \lfloor t \rfloor) is the periodic Bernoulli function. The integral of ff is (a+N)1−s/(s−1)(a+N)^{1-s}/(s-1), and the terms of the sum are those of the theorem. Both sides are analytic in ss for σ+2M>1\sigma + 2M > 1, s≠1s \ne 1, since the last integral converges there, so the formula holds in that domain. Finally ∣B~2M(t)∣≤∣B2M∣=2(2M)!ζ(2M)/(2π)2M<4(2M)!/(2π)2M|\tilde B_{2M}(t)| \le |B_{2M}| = 2 (2M)! \zeta(2M)/(2\pi)^{2M} < 4 (2M)!/(2\pi)^{2M}, so the remainder is at most 4∣(s)2M∣(2π)−2M∫N∞(a+t)−σ−2M dt4 |(s)_{2M}| (2\pi)^{-2M} \int_N^\infty (a+t)^{-\sigma-2M}\,dt.

[Joh2013] extends the bound to complex aa (with a factor depending on arg⁡(a+N)\arg(a + N)) and to the derivatives with respect to ss, by treating s+xs + x as a power series: the remainder of the expansion of ζ(s+x,a)\zeta(s + x, a) to length dd is bounded coefficientwise by an explicit integral of (a+t)−σ−2Mlog⁡k(a+t)(a+t)^{-\sigma-2M} \log^k(a+t), which is what _acb_poly_zeta_em_bound computes.

Choice of parameters. The terms of the Bernoulli sum first decrease like ∣s+2j∣2j/(2π(a+N))2j|s + 2j|^{2j}/(2\pi(a+N))^{2j} and then grow; the bound is small when NN and MM are both large compared with ∣s∣|s| and the precision. _acb_poly_zeta_em_choose_param takes M=min⁡(N,p+min⁡(N/100,2000))M = \min(N, p + \min(N/100, 2000)) for a target of pp bits and finds the smallest NN for which the bound is below 2−p2^{-p} times an estimate of ∣a−s∣|a^{-s}|, by doubling and bisection. For ss of moderate size this gives N,M=O(p)N, M = O(p). The cost is dominated by the NN powers (a+k)−s(a+k)^{-s} and the MM Bernoulli numbers (cached by bernoulli_cache_compute). The Bernoulli sum is evaluated term by term (_acb_poly_zeta_em_tail_naive), or by binary splitting (_acb_poly_zeta_em_tail_bsplit) for long power series (length at least 5 and at least M/10M/10). For large ∣t∣|t|, the remainder bound requires N≳∣t∣/(2π)N \gtrsim |t|/(2\pi), so the cost grows linearly with the height; this is why the Riemann–Siegel formula, with O(t)O(\sqrt{t}) terms, takes over there.

Power sums. The main sum ∑k<N(a+k)−(s+x)\sum_{k<N} (a+k)^{-(s+x)} is computed by _acb_poly_zeta_em_sum with one of several methods:

  • for a=1a = 1 and length ≤2\le 2: acb_dirichlet_powsum_sieved, which computes k−sk^{-s} only for prime kk and obtains the others as products (ij)−s=i−sj−s(ij)^{-s} = i^{-s} j^{-s} from a table, groups the even terms as a polynomial in 2−s2^{-s} evaluated by Horner's rule, and so needs about N/log⁡NN/\log N exponentials and N/2N/2 multiplications;
  • for a=1a = 1 and length ≤4\le 4: acb_dirichlet_powsum_smooth, which sieves only by the primes 2, 3 and 5 and uses logarithmic memory;
  • for longer series or general aa: a product tree (_acb_poly_powsum_series_tree), or a direct sum, in parallel when several threads are available.

The powers k−s=exp⁡(−slog⁡k)k^{-s} = \exp(-s \log k) are computed with the logarithm of a nearby integer when possible (acb_dirichlet_powsum_term), and the precision of each term is lowered according to its magnitude.

Reflection. For Re⁡(s)<0\operatorname{Re}(s) < 0 the Riemann zeta function uses the functional equation ζ(s)=2(2π)s−1sin⁡(πs/2)Γ(1−s)ζ(1−s)\zeta(s) = 2 (2\pi)^{s-1} \sin(\pi s/2) \Gamma(1-s) \zeta(1-s), also as power series, since the cost of Euler–Maclaurin summation grows with ∣s∣|s|.

The zeta function at integers#

At even positive integers, ζ(2n)=(−1)n+1B2n(2π)2n/(2(2n)!)\zeta(2n) = (-1)^{n+1} B_{2n} (2\pi)^{2n}/(2 (2n)!) is computed from the Bernoulli number when it is cheap (it is cached), and at negative integers ζ(−n)=−Bn+1/(n+1)\zeta(-n) = -B_{n+1}/(n+1). For large nn the Euler product

ζ(n)=∏p(1−p−n)−1,\zeta(n) = \prod_p (1 - p^{-n})^{-1},

truncated at the primes p<Pp < P, converges quickly: the relative error is at most about ζ(n,P)≈P1−n/(n−1)\zeta(n, P) \approx P^{1-n}/(n-1), so P≈2p/nP \approx 2^{p/n} primes suffice (arb_zeta_ui_euler_product, which bounds the tail by mag_hurwitz_zeta_uiui). For odd nn of moderate size, Borwein's algorithm [Bor2000]

ζ(s)=−1dn(1−21−s)∑k=0n−1(−1)k(dk−dn)(k+1)s+εn(s),dk=n∑i=0k(n+i−1)! 4i(n−i)!(2i)!,\zeta(s) = \frac{-1}{d_n (1 - 2^{1-s})} \sum_{k=0}^{n-1} \frac{(-1)^k (d_k - d_n)}{(k+1)^s} + \varepsilon_n(s), \qquad d_k = n \sum_{i=0}^{k} \frac{(n+i-1)! \, 4^i}{(n-i)! (2i)!},

has an error εn(s)\varepsilon_n(s) of order (3+8)−n(3 + \sqrt 8)^{-n} for real s≥1/2s \ge 1/2, so it needs n≈0.39pn \approx 0.39 p terms; arb_zeta_ui_vec_borwein evaluates it for several ss at once, and arb_zeta_ui_borwein_bsplit evaluates it by binary splitting at very high precision.

Taylor expansion in the parameter#

To evaluate ζ(s,a)\zeta(s, a) at many aa for a fixed ss, as needed for the L-functions of all characters of a modulus, acb_dirichlet_hurwitz_precomp_init precomputes Taylor expansions at grid points. With ζ(s,a)=∑j=0A−1(a+j)−s+ζ(s,a+A)\zeta(s, a) = \sum_{j=0}^{A-1} (a+j)^{-s} + \zeta(s, a + A) and the expansion

ζ(s,a+x)=∑k=0∞(−x)k(s)kk!ζ(s+k,a),\zeta(s,a+x) = \sum_{k=0}^{\infty} (-x)^k \frac{(s)_k}{k!} \zeta(s+k,a),

it stores KK coefficients at each of the NN points A+(2i+1)/(2N)A + (2i+1)/(2N), 0≤i<N0 \le i < N, which leaves ∣x∣≤1/(2N)|x| \le 1/(2N) for any a∈(0,1]a \in (0, 1]. Each evaluation then costs a polynomial evaluation of length KK and AA powers. The truncation error is bounded as follows.

Lemma 2. Let a≥1a \ge 1 be real, σ=Re⁡(s)\sigma = \operatorname{Re}(s), K+σ>1K + \sigma > 1, and let T(k)=∣x∣k∣(s)k∣k![a−σ−k+a1−σ−kσ+k−1]T(k) = |x|^k \frac{|(s)_k|}{k!} \left[ a^{-\sigma-k} + \frac{a^{1-\sigma-k}}{\sigma+k-1} \right]. Then the tail of the series satisfies

∑k=K∞∣x∣k∣(s)k∣k!ζ(σ+k,a)≤∑k=K∞T(k),\sum_{k=K}^{\infty} |x|^k \frac{|(s)_k|}{k!} \zeta(\sigma+k,a) \le \sum_{k = K}^\infty T(k),

and if

C=∣x∣a(1+1K+σ+a−1)(1+∣s−1∣K+1)<1,C = \frac{|x|}{a} \left(1 + \frac{1}{K+\sigma+a-1}\right) \left(1 + \frac{|s-1|}{K+1}\right) < 1,

then ∑k≥KT(k)≤T(K)/(1−C)\sum_{k \ge K} T(k) \le T(K)/(1 - C).

Proof. For real σ+k>1\sigma + k > 1, ζ(σ+k,a)≤a−σ−k+∫a∞u−σ−kdu=a−σ−k+a1−σ−k/(σ+k−1)\zeta(\sigma + k, a) \le a^{-\sigma-k} + \int_a^\infty u^{-\sigma-k} du = a^{-\sigma-k} + a^{1-\sigma-k}/(\sigma + k - 1), since the terms decrease, and ∣ζ(s+k,a)∣≤ζ(σ+k,a)|\zeta(s + k, a)| \le \zeta(\sigma + k, a). The ratio of consecutive terms is

T(k+1)T(k)=∣x∣ak+σ−1k+σk+σ+ak+σ+a−1∣k+s∣k+1≤∣x∣a(1+1K+σ+a−1)(1+∣s−1∣K+1)=C\frac{T(k+1)}{T(k)} = \frac{|x|}{a} \frac{k+\sigma-1}{k+\sigma} \frac{k+\sigma+a}{k+\sigma+a-1} \frac{|k+s|}{k+1} \le \frac{|x|}{a} \left(1 + \frac{1}{K+\sigma+a-1}\right) \left(1 + \frac{|s-1|}{K+1}\right) = C

for k≥Kk \ge K, using ∣k+s∣≤k+1+∣s−1∣|k + s| \le k + 1 + |s - 1|. The tail is then dominated by a geometric series.

With a≥Aa \ge A and ∣x∣≤1/(2N)|x| \le 1/(2N), C≈1/(2AN)C \approx 1/(2AN), so the error is O((2AN)−K)O((2AN)^{-K}); acb_dirichlet_hurwitz_precomp_bound evaluates this bound and acb_dirichlet_hurwitz_precomp_choose_param minimises the total cost NKNK (precomputation) plus (number of evaluations) ×\times (K+A)(K + A) subject to it.

Polylogarithms#

The polylogarithm Li⁡s(z)=∑k=1∞zkk−s\operatorname{Li}_s(z) = \sum_{k=1}^\infty z^k k^{-s} for ∣z∣<1|z| < 1, continued analytically with a branch cut on z∈(1,∞)z \in (1, \infty), is computed by acb_polylog, and its expansion in ss by acb_poly_polylog_series.

Small ∣z∣|z|. For ∣z∣<1/2|z| < 1/2, the series is summed directly, also for the derivatives with respect to ss: Li⁡s+x(z)=∑dxd(−1)dd!∑k≥1Td(k)\operatorname{Li}_{s+x}(z) = \sum_{d} x^d \frac{(-1)^d}{d!} \sum_{k \ge 1} T_d(k) with Td(k)=zklog⁡d(k)k−sT_d(k) = z^k \log^d(k) k^{-s}. The tail after NN terms is bounded by mag_polylog_tail: if U(k)U(k) is nonincreasing and Td(k+1)/Td(k)≤U(k)T_d(k+1)/T_d(k) \le U(k), then ∑k≥NTd(k)≤Td(N)/(1−U(N))\sum_{k \ge N} T_d(k) \le T_d(N) / (1 - U(N)) when U(N)<1U(N) < 1. One can take U(k)=∣z∣ B(k,max⁡(0,−σ)) B(klog⁡k,d)U(k) = |z| \, B(k, \max(0, -\sigma)) \, B(k\log k, d) with B(m,n)=(1+1/m)nB(m, n) = (1 + 1/m)^n, because (k/(k+1))σ≤(1+1/k)max⁡(0,−σ)(k/(k+1))^{\sigma} \le (1 + 1/k)^{\max(0,-\sigma)} and (log⁡(k+1)/log⁡k)d≤(1+1/(klog⁡k))d(\log(k+1)/\log k)^d \le (1 + 1/(k \log k))^d.

General zz. Otherwise, with s=1−vs = 1 - v,

Li⁡s(z)=Γ(v)(2π)v[ivζ(v,12+log⁡(−z)2πi)+i−vζ(v,12−log⁡(−z)2πi)],\operatorname{Li}_s(z) = \frac{\Gamma(v)}{(2\pi)^v} \left[ i^v \zeta\left(v, \frac{1}{2} + \frac{\log(-z)}{2\pi i}\right) + i^{-v} \zeta\left(v, \frac{1}{2} - \frac{\log(-z)}{2\pi i}\right) \right],

with the principal branch of log⁡(−z)\log(-z), which gives the conventional branch cut. The Hurwitz zeta functions are evaluated by Euler–Maclaurin summation with complex parameter. To expand in ss, vv is replaced by v+xv + x, the right side becomes Γ(v+x)[E1Z1+E2Z2]\Gamma(v+x) [E_1 Z_1 + E_2 Z_2] with E1=(i/(2π))v+xE_1 = (i/(2\pi))^{v+x} and E2=(1/(2πi))v+xE_2 = (1/(2\pi i))^{v+x}, and xx is mapped to −x-x at the end. At v=1v = 1 the Hurwitz zeta functions have poles; with the deflated Z~j=Zj−1/x\tilde Z_j = Z_j - 1/x, E1Z1+E2Z2=(E1+E2)/x+E1Z~1+E2Z~2E_1 Z_1 + E_2 Z_2 = (E_1 + E_2)/x + E_1 \tilde Z_1 + E_2 \tilde Z_2, where (E1+E2)/x(E_1+E_2)/x is a power series since E1+E2E_1 + E_2 vanishes at x=0x = 0. At v=0,−1,−2,…v = 0, -1, -2, \ldots, where Γ\Gamma has a pole, the product xΓ(v+x)⋅[E1Z1+E2Z2]/xx\Gamma(v+x) \cdot [E_1 Z_1 + E_2 Z_2]/x is formed instead. These cancellations require ss to be an exact integer; a small ball around 0,1,2,…0, 1, 2, \ldots gives an indeterminate result. The method is inefficient for ∣z∣→0|z| \to 0 (where the direct series is used) and for ∣z∣→∞|z| \to \infty, where an asymptotic expansion would be better. For s=2s = 2, acb_hypgeom_dilog is used instead (The dilogarithm).

Dirichlet L-functions#

For a character χ\chi modulo qq,

L(s,χ)=∑k=1∞χ(k)ks=q−s∑k=1qχ(k) ζ ⁣(s,kq),L(s, \chi) = \sum_{k=1}^{\infty} \frac{\chi(k)}{k^s} = q^{-s} \sum_{k=1}^{q} \chi(k) \, \zeta\!\left(s, \frac{k}{q}\right),

and acb_dirichlet_l uses this decomposition (acb_dirichlet_l_hurwitz) in general, computing the ϕ(q)\phi(q) Hurwitz zeta values with the Taylor expansion of Taylor expansion in the parameter when that is cheaper. At s=1s = 1, the deflated values ζ(s,a)−1/(s−1)\zeta(s, a) - 1/(s-1) are used, since the poles cancel for non-principal χ\chi. acb_dirichlet_l_vec_hurwitz computes L(s,χ)L(s, \chi) for all χ\chi modulo qq at once: the map from the vector (ζ(s,k/q))k(\zeta(s, k/q))_k to (L(s,χ))χ(L(s, \chi))_\chi is a discrete Fourier transform on the group of characters (acb_dirichlet_dft_index), so the cost is ϕ(q)\phi(q) Hurwitz zeta values plus O(ϕ(q)log⁡ϕ(q))O(\phi(q) \log \phi(q)) operations.

For large Re⁡(s)\operatorname{Re}(s), from about 8+p/(2log⁡p)8 + p/(2\log p), the Euler product 1/L(s,χ)=∏p(1−χ(p)p−s)1/L(s,\chi) = \prod_p (1 - \chi(p) p^{-s}) is used; the truncation at p<Pp < P leaves an error at most ζ(Re⁡(s),P)\zeta(\operatorname{Re}(s), P) in 1/L1/L, because the truncated product contains all terms μ(k)χ(k)k−s\mu(k)\chi(k)k^{-s} with PP-smooth kk.

For primitive χ\chi of parity δ\delta, the completed function Λ(s,χ)=(q/π)(s+δ)/2Γ((s+δ)/2)L(s,χ)\Lambda(s, \chi) = (q/\pi)^{(s+\delta)/2} \Gamma((s+\delta)/2) L(s,\chi) satisfies Λ(s,χ)=ϵ(χ)Λ(1−s,χ‾)\Lambda(s, \chi) = \epsilon(\chi) \Lambda(1 - s, \overline\chi), which moves evaluations from Re⁡(s)<−1/2\operatorname{Re}(s) < -1/2 to the right half-plane. The root number is ϵ(χ)=G(χ)/(iδq)\epsilon(\chi) = G(\chi)/(i^\delta \sqrt{q}), where the Gauss sum G(χ)=∑xχ(x)e2πix/qG(\chi) = \sum_x \chi(x) e^{2\pi i x/q} factors over the prime powers dividing qq by the Chinese remainder theorem. It can also be obtained from the theta series Θ(χ,t)=∑n∈Zχ(n)nδe−πn2t2/q\Theta(\chi, t) = \sum_{n \in \mathbb{Z}} \chi(n) n^\delta e^{-\pi n^2 t^2/q}, which satisfies t1/2+δΘ(χ,t)=ϵ(χ)Θ(χ‾,1/t)t^{1/2+\delta}\Theta(\chi, t) = \epsilon(\chi)\Theta(\overline{\chi}, 1/t), so that ϵ(χ)=Θ(χ,1)/Θ(χ,1)‾\epsilon(\chi) = \Theta(\chi, 1)/\overline{\Theta(\chi, 1)} whenever Θ(χ,1)≠0\Theta(\chi, 1) \ne 0; this needs O(pq)O(\sqrt{pq}) terms.

The Mellin transform of the theta series gives the approximate functional equation, a sum of incomplete gamma functions,

Λ(s,χ)=∑n=1∞χ(n)(qπ)s+δ2Γ(s+δ2,πn2q)ns+ϵ(χ)∑n=1∞χ‾(n)(qπ)1−s+δ2Γ(1−s+δ2,πn2q)n1−s,\Lambda(s, \chi) = \sum_{n=1}^{\infty} \chi(n) \left(\frac{q}{\pi}\right)^{\frac{s+\delta}{2}} \frac{\Gamma\bigl(\frac{s+\delta}{2}, \frac{\pi n^2}{q}\bigr)}{n^s} + \epsilon(\chi) \sum_{n=1}^{\infty} \overline{\chi}(n) \left(\frac{q}{\pi}\right)^{\frac{1-s+\delta}{2}} \frac{\Gamma\bigl(\frac{1-s+\delta}{2}, \frac{\pi n^2}{q}\bigr)}{n^{1-s}},

whose terms decrease like e−πn2/qe^{-\pi n^2/q}, so O(pq)O(\sqrt{pq}) terms suffice at precision pp [Coh2007b]. acb_dirichlet_l_fmpq_afe uses it for rational ss, for which the upper incomplete gamma function with rational parameter can be computed efficiently (by its asymptotic series when possible), with each term computed at the precision its magnitude requires; it is faster than Euler–Maclaurin summation at very high precision or for large qq. acb_dirichlet_l_fmpq_afe_jet computes the Taylor expansion in ss in the same way, with the incomplete gamma functions expanded with respect to their parameter; this is used for jets of ζ(s)\zeta(s) and L(s,χ)L(s,\chi) at exact rational ss (acb_dirichlet_zeta_jet, acb_dirichlet_l_jet), and thereby for Glaisher's constant and the Stieltjes constants γn\gamma_n at very high precision. The cost is O~(p1.5)\tilde O(p^{1.5}) and the memory O(p)O(p), compared with O~(p2)\tilde O(p^2) and O(p2)O(p^2) for Euler–Maclaurin summation. Since Γ(s,z)\Gamma(s, z) is computed by binary splitting over rational parameters, only ss of small height can be handled; from an acb_t, these are the dyadic numbers.

Other functions#

Lerch transcendent. Φ(z,s,a)=∑k≥0zk(k+a)−s\Phi(z, s, a) = \sum_{k \ge 0} z^k (k+a)^{-s} reduces to the Hurwitz zeta function for z=1z = 1, to the Dirichlet eta function, digamma or Hurwitz zeta functions for z=−1z = -1, and to polylogarithms for a=1a = 1. Otherwise acb_dirichlet_lerch_phi sums the series directly when ∣z∣≤0.875|z| \le 0.875, and else evaluates the Hankel contour integral Φ(z,s,a)=−Γ(1−s)2πi∫C(−t)s−1e−at1−ze−tdt\Phi(z,s,a) = -\frac{\Gamma(1-s)}{2 \pi i} \int_C \frac{(-t)^{s-1} e^{-a t}}{1 - z e^{-t}} dt with acb_calc_integrate, deforming the contour around the poles t=log⁡z+2πikt = \log z + 2\pi i k.

Stieltjes constants. The generalised Stieltjes constants γn(a)\gamma_n(a) are the coefficients of the Laurent expansion of ζ(s,a)\zeta(s, a) at s=1s = 1. For moderate nn, they are read off from the Euler–Maclaurin expansion of ζ(s+x,a)\zeta(s + x, a) at s=1s = 1 with deflation (for a=1a = 1 and very high precision, from the approximate functional equation instead); for large nn, acb_dirichlet_stieltjes integrates a representation along a contour that avoids the cancellation of the power series method [JB2018], which makes very large nn, such as 1010010^{100}, feasible.

Use in FLINT#

The tutorial The Riemann zeta function, its zeros and L-functions evaluates the zeta function, its zeros and L-functions in complete programs.

Referenced from#

References#

Cite this page

The FLINT team, “Zeta functions, polylogarithms and L-functions,” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/algorithms/special-functions/zeta.html (generated 2026-11-02).