FLINT3.7.0-dev

acb_dirichlet_l_ui_borwein_bsplit

Synopsis#include <flint/acb_dirichlet.h>
void acb_dirichlet_l_ui_borwein_bsplit(acb_t res, ulong s, const dirichlet_group_t G, const dirichlet_char_t chi, slong prec)source

Sets res to L(s,χ)L(s,\chi) for an integer s≥1s \ge 1 and a primitive character χ\chi modulo qq (with G = NULL for q=1q = 1), using a generalization of Borwein's algorithm for the Riemann zeta function (arb_zeta_ui_borwein_bsplit) with binary splitting, which costs O~(ϕ(q)p)\tilde O(\phi(q) p) at precision pp.

If 4∣q4 \mid q, the 2-component of χ\chi is primitive, which implies that χ(n+Q)=−χ(n)\chi(n + Q) = -\chi(n) with Q=q/2Q = q/2; if qq is odd, we instead use ∑n(−1)n−1χ(n)n−s=(1−χ(2)21−s)L(s,χ)\sum_n (-1)^{n-1} \chi(n) n^{-s} = (1 - \chi(2) 2^{1-s}) L(s,\chi) with Q=qQ = q. In both cases, L(s,χ)L(s,\chi) is a linear combination over the residues aa modulo QQ of alternating series ∑j≥0(−1)j(Qj+a)−s\sum_{j \ge 0} (-1)^j (Q j + a)^{-s}, whose terms are moments of a positive measure on [0,1][0,1] with total mass a−sa^{-s}. Borwein's acceleration with nn terms therefore has error at most 3a−s/(3+8)n3 a^{-s} / (3+\sqrt{8})^n for each series. The series are evaluated together by one binary splitting over vectors (several in parallel when threads are available), and the character values only enter in the final linear combination.

The output is indeterminate if the character is not primitive, if q≡2(mod4)q \equiv 2 \pmod 4 (there are then no primitive characters), and if s=1s = 1, qq is odd and χ(2)=1\chi(2) = 1 (when the factor 1−χ(2)21−s1 - \chi(2) 2^{1-s} vanishes).

Cite this page

The FLINT team, “acb_dirichlet_l_ui_borwein_bsplit (acb_dirichlet.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/acb_dirichlet/acb_dirichlet_l_ui_borwein_bsplit.html (generated 2026-11-02).