Zeta functions, polylogarithms and L-functions
- Cost
- terms for by Euler–Maclaurin summation at precision and height ; by the Riemann–Siegel formula; prime powers for the Euler product at large .
The Hurwitz zeta function
and its analytic continuation to are the core of a family of functions: the Riemann zeta function , 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 and its derivatives with respect to 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 when many values with the same are needed.
Overview of methods#
| Function | Method |
|---|---|
acb_dirichlet_zeta, acb_zeta | integers: Bernoulli numbers (negative), arb_zeta_ui (positive); : Riemann–Siegel; : reflection formula; exact dyadic at high precision: approximate functional equation; otherwise Euler–Maclaurin |
acb_dirichlet_zeta_jet | Euler–Maclaurin for any length (reflection for ); Riemann–Siegel for length high on the critical line; exact rational of small height at very high precision: approximate functional equation |
acb_dirichlet_hurwitz, acb_hurwitz_zeta | special values (, , negative integers via Bernoulli polynomials); otherwise Euler–Maclaurin (_acb_poly_zeta_cpx_series) |
arb_zeta_ui | : asymptotic; even : Bernoulli numbers or Euler product; , : constants; small odd at huge precision: Borwein's algorithm by binary splitting; large odd : Euler product; otherwise Borwein's algorithm |
acb_dirichlet_hurwitz_precomp_eval | Taylor expansion in on a grid (Taylor expansion in the parameter) |
acb_polylog | : direct series; : acb_hypgeom_dilog; otherwise two Hurwitz zeta values (Polylogarithms) |
acb_dirichlet_l | Dirichlet L-functions |
acb_dirichlet_stieltjes | integral representation [JB2018], or a Hurwitz zeta series at (via acb_dirichlet_zeta_jet for , so with the approximate functional equation at very high precision) |
Euler–Maclaurin summation#
Applying the Euler–Maclaurin formula to on gives the following representation, valid for all by analytic continuation.
Theorem 1 (Euler–Maclaurin formula for the Hurwitz zeta function). Let be real, and integers, and with , . Then
where and
Proof. For , the Euler–Maclaurin formula for , whose derivatives are , gives
where is the periodic Bernoulli function. The integral of is , and the terms of the sum are those of the theorem. Both sides are analytic in for , , since the last integral converges there, so the formula holds in that domain. Finally , so the remainder is at most .
[Joh2013] extends the bound to complex (with a factor depending on ) and to the derivatives with respect to , by treating as a power series: the remainder of the expansion of to length is bounded coefficientwise by an explicit integral of , which is what _acb_poly_zeta_em_bound computes.
Choice of parameters. The terms of the Bernoulli sum first decrease like and then grow; the bound is small when and are both large compared with and the precision. _acb_poly_zeta_em_choose_param takes for a target of bits and finds the smallest for which the bound is below times an estimate of , by doubling and bisection. For of moderate size this gives . The cost is dominated by the powers and the 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 ). For large , the remainder bound requires , so the cost grows linearly with the height; this is why the Riemann–Siegel formula, with terms, takes over there.
Power sums. The main sum is computed by _acb_poly_zeta_em_sum with one of several methods:
- for and length :
acb_dirichlet_powsum_sieved, which computes only for prime and obtains the others as products from a table, groups the even terms as a polynomial in evaluated by Horner's rule, and so needs about exponentials and multiplications; - for and length :
acb_dirichlet_powsum_smooth, which sieves only by the primes 2, 3 and 5 and uses logarithmic memory; - for longer series or general : a product tree (
_acb_poly_powsum_series_tree), or a direct sum, in parallel when several threads are available.
The powers 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 the Riemann zeta function uses the functional equation , also as power series, since the cost of Euler–Maclaurin summation grows with .
The zeta function at integers#
At even positive integers, is computed from the Bernoulli number when it is cheap (it is cached), and at negative integers . For large the Euler product
truncated at the primes , converges quickly: the relative error is at most about , so primes suffice (arb_zeta_ui_euler_product, which bounds the tail by mag_hurwitz_zeta_uiui). For odd of moderate size, Borwein's algorithm [Bor2000]
has an error of order for real , so it needs terms; arb_zeta_ui_vec_borwein evaluates it for several at once, and arb_zeta_ui_borwein_bsplit evaluates it by binary splitting at very high precision.
Taylor expansion in the parameter#
To evaluate at many for a fixed , as needed for the L-functions of all characters of a modulus, acb_dirichlet_hurwitz_precomp_init precomputes Taylor expansions at grid points. With and the expansion
it stores coefficients at each of the points , , which leaves for any . Each evaluation then costs a polynomial evaluation of length and powers. The truncation error is bounded as follows.
Lemma 2. Let be real, , , and let . Then the tail of the series satisfies
and if
then .
Proof. For real , , since the terms decrease, and . The ratio of consecutive terms is
for , using . The tail is then dominated by a geometric series.
With and , , so the error is ; acb_dirichlet_hurwitz_precomp_bound evaluates this bound and acb_dirichlet_hurwitz_precomp_choose_param minimises the total cost (precomputation) plus (number of evaluations) subject to it.
Polylogarithms#
The polylogarithm for , continued analytically with a branch cut on , is computed by acb_polylog, and its expansion in by acb_poly_polylog_series.
Small . For , the series is summed directly, also for the derivatives with respect to : with . The tail after terms is bounded by mag_polylog_tail: if is nonincreasing and , then when . One can take with , because and .
General . Otherwise, with ,
with the principal branch of , which gives the conventional branch cut. The Hurwitz zeta functions are evaluated by Euler–Maclaurin summation with complex parameter. To expand in , is replaced by , the right side becomes with and , and is mapped to at the end. At the Hurwitz zeta functions have poles; with the deflated , , where is a power series since vanishes at . At , where has a pole, the product is formed instead. These cancellations require to be an exact integer; a small ball around gives an indeterminate result. The method is inefficient for (where the direct series is used) and for , where an asymptotic expansion would be better. For , acb_hypgeom_dilog is used instead (The dilogarithm).
Dirichlet L-functions#
For a character modulo ,
and acb_dirichlet_l uses this decomposition (acb_dirichlet_l_hurwitz) in general, computing the Hurwitz zeta values with the Taylor expansion of Taylor expansion in the parameter when that is cheaper. At , the deflated values are used, since the poles cancel for non-principal . acb_dirichlet_l_vec_hurwitz computes for all modulo at once: the map from the vector to is a discrete Fourier transform on the group of characters (acb_dirichlet_dft_index), so the cost is Hurwitz zeta values plus operations.
For large , from about , the Euler product is used; the truncation at leaves an error at most in , because the truncated product contains all terms with -smooth .
For primitive of parity , the completed function satisfies , which moves evaluations from to the right half-plane. The root number is , where the Gauss sum factors over the prime powers dividing by the Chinese remainder theorem. It can also be obtained from the theta series , which satisfies , so that whenever ; this needs terms.
The Mellin transform of the theta series gives the approximate functional equation, a sum of incomplete gamma functions,
whose terms decrease like , so terms suffice at precision [Coh2007b]. acb_dirichlet_l_fmpq_afe uses it for rational , 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 . acb_dirichlet_l_fmpq_afe_jet computes the Taylor expansion in in the same way, with the incomplete gamma functions expanded with respect to their parameter; this is used for jets of and at exact rational (acb_dirichlet_zeta_jet, acb_dirichlet_l_jet), and thereby for Glaisher's constant and the Stieltjes constants at very high precision. The cost is and the memory , compared with and for Euler–Maclaurin summation. Since is computed by binary splitting over rational parameters, only of small height can be handled; from an acb_t, these are the dyadic numbers.
Other functions#
Lerch transcendent. reduces to the Hurwitz zeta function for , to the Dirichlet eta function, digamma or Hurwitz zeta functions for , and to polylogarithms for . Otherwise acb_dirichlet_lerch_phi sums the series directly when , and else evaluates the Hankel contour integral with acb_calc_integrate, deforming the contour around the poles .
Stieltjes constants. The generalised Stieltjes constants are the coefficients of the Laurent expansion of at . For moderate , they are read off from the Euler–Maclaurin expansion of at with deflation (for and very high precision, from the approximate functional equation instead); for large , acb_dirichlet_stieltjes integrates a representation along a contour that avoids the cancellation of the power series method [JB2018], which makes very large , such as , feasible.
Use in FLINT#
acb_dirichlet_zeta,acb_dirichlet_zeta_jet,acb_dirichlet_hurwitz,acb_dirichlet_eta,acb_dirichlet_xi(acb_dirichlet);acb_zetaandacb_hurwitz_zetaare wrappers._acb_poly_zeta_cpx_series,_acb_poly_zeta_em_choose_param,_acb_poly_zeta_em_bound,_acb_poly_zeta_em_sum,_acb_poly_zeta_em_tail_bsplit,acb_poly_zeta_series(acb_poly): Euler–Maclaurin summation.acb_dirichlet_powsum_sieved,acb_dirichlet_powsum_smooth,_acb_poly_powsum_series_tree: power sums.arb_zeta_ui,arb_zeta_ui_euler_product,arb_zeta_ui_vec_borwein,arb_zeta_ui_borwein_bsplit,arb_zeta_ui_bernoulli(arb).acb_dirichlet_hurwitz_precomp_init,acb_dirichlet_hurwitz_precomp_bound,acb_dirichlet_hurwitz_precomp_eval.acb_polylog,acb_poly_polylog_series,mag_polylog_tail.acb_dirichlet_l,acb_dirichlet_l_hurwitz,acb_dirichlet_l_euler_product,acb_dirichlet_l_vec_hurwitz,acb_dirichlet_l_fmpq_afe,acb_dirichlet_l_fmpq_afe_jet,acb_dirichlet_root_number,acb_dirichlet_gauss_sum,acb_dirichlet_theta_arb.acb_dirichlet_lerch_phi,acb_dirichlet_stieltjes.
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#
- acb_dirichlet.h (module)
acb_dirichlet_hurwitz_precomp_init- Evaluating Dirichlet L-functions
- acb_poly.h (module)
_acb_poly_zeta_cpx_series_acb_poly_polylog_cpx_small,_acb_poly_polylog_cpx_zeta,_acb_poly_polylog_cpx- Taylor series of complex functions
- Error propagation (algorithm)
- Mathematical constants (algorithm)
- The dilogarithm (algorithm)
- Evaluating special functions (overview)
- Zeros of the Riemann zeta function (algorithm)
- arb.h (module)
_arb_poly_zeta_series,arb_poly_zeta_seriesgr_hurwitz_zetamag_polylog_tail- Summing a series with a rigorous error bound (tutorial)
- The Riemann zeta function, its zeros and L-functions (tutorial)
References#
- [Joh2013] F. Johansson, "Rigorous high-precision computation of the Hurwitz zeta function and its derivatives", Numerical Algorithms, http://arxiv.org/abs/1309.2877 https://doi.org/10.1007/s11075-014-9893-1
- [JB2018] F. Johansson and I. Blagouchine. "Computing Stieltjes constants using complex integration", preprint (2018), https://arxiv.org/abs/1804.01679
- [Bor2000] P. Borwein, "An Efficient Algorithm for the Riemann Zeta Function", Constructive experimental and nonlinear analysis, CMS Conference Proc. 27 (2000) 29-34, http://www.cecm.sfu.ca/personal/pborwein/PAPERS/P155.pdf
- [Coh2007b] H. Cohen, Number Theory, Volume II: Analytic and Modern Tools, Graduate Texts in Mathematics 240, Springer, 2007. https://doi.org/10.1007/978-0-387-49894-2
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).
@misc{flint-doc-algorithms-special-functions-zeta,
author = {{The FLINT team}},
title = {{Zeta functions, polylogarithms and L-functions}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/algorithms/special-functions/zeta.html},
note = {Generated 2026-11-02}
}