FLINT3.7.0-dev
Algorithm

Multiple zeta values and multiple polylogarithms

The multiple zeta values

ζ(s1,…,sr)=∑n1>n2>⋯>nr≥11n1s1⋯nrsr(s1≥2)\zeta(s_1, \ldots, s_r) = \sum_{n_1 > n_2 > \cdots > n_r \ge 1} \frac{1}{n_1^{s_1} \cdots n_r^{s_r}} \qquad (s_1 \ge 2)

and the multiple polylogarithms

Li⁡s1,…,sr(x1,…,xr)=∑n1>⋯>nr≥1x1n1⋯xrnrn1s1⋯nrsr\operatorname{Li}_{s_1, \ldots, s_r}(x_1, \ldots, x_r) = \sum_{n_1 > \cdots > n_r \ge 1} \frac{x_1^{n_1} \cdots x_r^{n_r}}{n_1^{s_1} \cdots n_r^{s_r}}

are computed in acb_mzeta from their representations as iterated integrals. For multiple zeta values FLINT uses Akhilesh's double tails [Akh2017], a recursion with O(k2)O(k^2) values per level and about P/2P/2 levels for weight kk and PP bits, carried out in fixed-point arithmetic with exactly counted rounding errors; at very high precision, Hölder convolution [BBBL2001] reduces the value to multiple polylogarithms at 12\tfrac12, which are evaluated by binary splitting in quasi-linear time. General multiple polylogarithms are written as Goncharov's iterated integrals [Gon2001] and summed as power series, directly or after splitting the path at 12\tfrac12.

Words and iterated integrals#

With the differential forms ω0=dt/t\omega_0 = dt/t and ω1=dt/(1−t)\omega_1 = dt/(1-t), a word w=e1⋯ekw = e_1 \cdots e_k in the letters x0,x1x_0, x_1 defines the iterated integral

ζ(w)=∫1>t1>⋯>tk>0ωe1(t1)⋯ωek(tk),\zeta(w) = \int_{1 > t_1 > \cdots > t_k > 0} \omega_{e_1}(t_1) \cdots \omega_{e_k}(t_k),

which converges when ww is admissible: it starts with x0x_0 and ends with x1x_1. Expanding 1/(1−t)1/(1 - t) as a geometric series and integrating term by term gives

ζ(s1,…,sr)=ζ(x0s1−1x1x0s2−1x1⋯x0sr−1x1),\zeta(s_1, \ldots, s_r) = \zeta(x_0^{s_1 - 1} x_1 x_0^{s_2 - 1} x_1 \cdots x_0^{s_r - 1} x_1),

so the weight k=s1+⋯+srk = s_1 + \cdots + s_r is the length of the word and the depth rr is the number of letters x1x_1. The admissible words of weight kk are x0yx1x_0 y x_1 for all 2k−22^{k-2} words yy of length k−2k - 2; acb_mzeta_mzv_index numbers them by the binary integer m=(1y)2m = (1y)_2, writing x0=0x_0 = 0 and x1=1x_1 = 1, so that the indices of weight kk are 2k−2≤m<2k−12^{k-2} \le m < 2^{k-1}. The substitution t↦1−tt \mapsto 1 - t shows that ζ(w)=ζ(w∗)\zeta(w) = \zeta(w^*) for the dual word w∗w^*, obtained by reversing ww and exchanging the letters; it is admissible when ww is.

Double tails#

Akhilesh's double tails of a word ww (not necessarily admissible) are

ζ(w)m,n=∫1>t1>⋯>tk>0(1−t1)m ωe1(t1)⋯ωek(tk) tkn,m,n≥0,\zeta(w)_{m,n} = \int_{1 > t_1 > \cdots > t_k > 0} (1 - t_1)^m\, \omega_{e_1}(t_1) \cdots \omega_{e_k}(t_k)\, t_k^n, \qquad m, n \ge 0,

with ζ(w)0,0=ζ(w)\zeta(w)_{0,0} = \zeta(w) for admissible ww.

Lemma 1 (Recurrences). For words uu,

ζ(x1u)m,n=ζ(u)m,nm,ζ(ux0)m,n=ζ(u)m,nn,ζ(∅)m,n=m! n!(m+n)!\zeta(x_1 u)_{m,n} = \frac{\zeta(u)_{m,n}}{m}, \qquad \zeta(u x_0)_{m,n} = \frac{\zeta(u)_{m,n}}{n}, \qquad \zeta(\varnothing)_{m,n} = \frac{m!\, n!}{(m+n)!}

(for m≥1m \ge 1, respectively n≥1n \ge 1), and

ζ(x0ux1)m,n=ζ(x0ux1)m+1,n+1+ζ(ux1)m+1,nm+1+ζ(x0u)m+1,n+1n+1.\zeta(x_0 u x_1)_{m,n} = \zeta(x_0 u x_1)_{m+1,n+1} + \frac{\zeta(u x_1)_{m+1,n}}{m+1} + \frac{\zeta(x_0 u)_{m+1,n+1}}{n+1}.

Proof. For the first identity, integrate out t1t_1: ∫t21(1−t1)m−1dt1=(1−t2)m/m\int_{t_2}^1 (1 - t_1)^{m-1} dt_1 = (1 - t_2)^m / m; the second is the same with tkt_k and ∫0tk−1tkn−1dtk=tk−1n/n\int_0^{t_{k-1}} t_k^{n-1} dt_k = t_{k-1}^n / n, and the third is the beta integral. Writing (1−t1)m=(1−t1)m+1+t1(1−t1)m(1 - t_1)^m = (1 - t_1)^{m+1} + t_1 (1 - t_1)^m,

ζ(x0v)m,n=ζ(x0v)m+1,n+ζ(v)m+1,nm+1,\zeta(x_0 v)_{m,n} = \zeta(x_0 v)_{m+1,n} + \frac{\zeta(v)_{m+1,n}}{m+1},

since t1⋅dt1/t1=dt1t_1 \cdot dt_1/t_1 = dt_1 and ∫t21(1−t1)mdt1=(1−t2)m+1/(m+1)\int_{t_2}^1 (1-t_1)^m dt_1 = (1 - t_2)^{m+1}/(m+1). In the same way, from tkn=tkn+1+(1−tk)tknt_k^n = t_k^{n+1} + (1 - t_k) t_k^n, ζ(vx1)m,n=ζ(vx1)m,n+1+ζ(v)m,n+1/(n+1)\zeta(v x_1)_{m,n} = \zeta(v x_1)_{m,n+1} + \zeta(v)_{m,n+1}/(n+1). Applying the first relation to v=ux1v = u x_1 and the second to ζ(x0ux1)m+1,n\zeta(x_0 u x_1)_{m+1,n} gives the diagonal step.

Every word reduces by these rules to shorter words or to the same word with (m,n)(m, n) increased by (1,1)(1, 1), so all values are determined by those at a large level n=Nn = N. Moreover a subword w[i..j)w[i..j) of ww appears in the recursion only with m−n=dim - n = d_i, the number of letters x0x_0 in w[0..i)w[0..i). The algorithm therefore stores, at level nn, one value ζ(u)n+d,n\zeta(u)_{n + d, n} per state (u,d)=(w[i..j),di)(u, d) = (w[i..j), d_i), at most O(k2)O(k^2) values, and computes the levels n=N,N−1,…,0n = N, N-1, \ldots, 0 with the values of level N+1N + 1 replaced by zero; within a level the states are processed by increasing length. Only two levels are kept in memory. At level 0 only the states reachable from the requested words are computed.

Lemma 2 (Size of the tails). For a word uu with aa letters x1x_1 and bb letters x0x_0, ζ(u)m,n≤max⁡0≤t≤1(1−t)m−atn−b\zeta(u)_{m,n} \le \max_{0 \le t \le 1} (1-t)^{m-a} t^{n-b} when m≥am \ge a and n≥bn \ge b. In particular, at level n≥kn \ge k every value is at most 4−(n−k)(2n+1)4^{-(n - k)} (2n + 1).

Proof. On the simplex t1≥tj≥tkt_1 \ge t_j \ge t_k, so the density of a letter x1x_1 at position jj is 1/(1−tj)≤1/(1−t1)1/(1 - t_j) \le 1/(1 - t_1) and that of a letter x0x_0 is 1/tj≤1/tk1/t_j \le 1/t_k. The integrand is therefore at most (1−t1)m−atkn−b≤(1−t1)m−at1n−b(1-t_1)^{m-a} t_k^{n-b} \le (1-t_1)^{m-a} t_1^{n-b}, and the simplex has volume at most 1. At level nn the exponents m−am - a and n−bn - b are at least n−kn - k and max⁡t((1−t)t)n−k=4−(n−k)\max_t ((1-t) t)^{n-k} = 4^{-(n-k)}; for the empty word, m! n!/(m+n)!≤1/(2nn)≤(2n+1)/4nm!\, n!/(m+n)! \le 1/\binom{2n}{n} \le (2n+1)/4^n.

So N≈P/2+O(log⁡P)N \approx P/2 + O(\log P) levels suffice for PP bits, and in the fixed-point format of about 2N2N fraction bits the values at level nn have only about 2(N−n)2(N - n) significant bits: the precision of each level is tapered accordingly.

Theorem 3 (Truncation). If every value dropped at level N+1N + 1 is bounded by GG (for example by Lemma 2), the error of the values at level 0 caused by replacing them by zero is at most 3(N+1)(N+2) G3 (N+1)(N+2)\, G.

Proof. Let ϵn\epsilon_n bound the errors of all values at level nn, so ϵN+1=G\epsilon_{N+1} = G. In the diagonal step at level n≥1n \ge 1, the terms ζ(x0ux1)m+1,n+1\zeta(x_0 u x_1)_{m+1,n+1} and ζ(x0u)m+1,n+1/(n+1)\zeta(x_0 u)_{m+1,n+1}/(n+1) belong to level n+1n + 1 and contribute at most (1+1n+1)ϵn+1(1 + \frac{1}{n+1}) \epsilon_{n+1}, while ζ(ux1)m+1,n/(m+1)\zeta(u x_1)_{m+1,n}/(m+1) belongs to level nn (its offset is one larger) and contributes at most ϵn/(n+1)\epsilon_n / (n+1), since m≥nm \ge n. The other rules divide by m,n≥1m, n \ge 1 and do not increase errors. Hence ϵn≤(1+1n+1)ϵn+1+ϵnn+1\epsilon_n \le (1 + \frac{1}{n+1}) \epsilon_{n+1} + \frac{\epsilon_n}{n+1}, that is ϵn≤n+2nϵn+1\epsilon_n \le \frac{n+2}{n} \epsilon_{n+1}. At level 0 the same count gives E≤2ϵ1+E/2E \le 2 \epsilon_1 + E/2, so E≤4ϵ1E \le 4 \epsilon_1, for the states with offset m≥1m \ge 1, and then 2ϵ1+E≤6ϵ12 \epsilon_1 + E \le 6 \epsilon_1 for the words themselves (m=0m = 0). So ϵ0≤6∏n=1Nn+2n G=3(N+1)(N+2) G\epsilon_0 \le 6 \prod_{n=1}^{N} \frac{n+2}{n}\, G = 3 (N+1)(N+2)\, G.

Arithmetic. All quantities are nonnegative, and the recursion is run in fixed point with BB fraction bits (one integer limb on top) with truncating divisions by the small integers mm, nn, m+1m + 1, n+1n + 1. Every computed value is then a lower bound for the exact one, and its error is an integer number of ulps that is counted exactly alongside the values (one ulp per truncating operation, propagated through the same linear recurrences). The empty-word values are carried as 4nm! n!/(m+n)!4^n m!\, n!/(m+n)!, whose step ratio is close to 1, and shifted down when used. The cost is dominated by the divisions by one limb: the two divisions of a diagonal step are merged into one by (m+1)(n+1)(m+1)(n+1), and several independent divisions (states of the same length, whose children are shorter) are interleaved with precomputed inverses [GraMol2010] to hide the latency of the remainder chain. The total cost is O(k2P2)O(k^2 P^2) bit operations.

Several words at once#

Different words share subwords, and the recursion can carry the states of several words together. This is used for:

  • Star values. ζ⋆(s)=∑n1≥⋯≥nrn1−s1⋯nr−sr\zeta^\star(s) = \sum_{n_1 \ge \cdots \ge n_r} n_1^{-s_1} \cdots n_r^{-s_r} is the sum of ζ(p)\zeta(p) over the 2r−12^{r-1} indices pp obtained from ss by replacing some commas by plus signs.
  • Yamamoto's interpolation [Yam2013] ζt(s)=∑ptr−depth⁡(p)ζ(p)\zeta^t(s) = \sum_p t^{r - \operatorname{depth}(p)} \zeta(p) over the same indices: the coefficients cj=∑depth⁡(p)=r−jζ(p)c_j = \sum_{\operatorname{depth}(p) = r - j} \zeta(p) are computed together and the polynomial is evaluated at tt by Horner's rule, so for tt far from [0,1][0, 1] the error is relative to the largest term.
  • All values of a weight. acb_mzeta_mzv_all evaluates all 2k−22^{k-2} admissible words of weight kk (or all weights up to kk) in batches limited by memory, so that each state is computed once per batch, and forms star values by summing over the merges.

Hölder convolution#

At very high precision the quadratic cost of the double tails is replaced by a quasi-linear algorithm [BBBL2001]. Splitting the integration domain of ζ(w)\zeta(w) at 12\tfrac12 (Chen's formula) and substituting t↦1−tt \mapsto 1 - t in the variables above 12\tfrac12 gives

ζ(w)=∑j=0kI(w∗[k−j..k)) I(w[j..k)),I(u)=∫12>t1>⋯>tL>0ωu1(t1)⋯ωuL(tL).\zeta(w) = \sum_{j=0}^{k} I(w^*[k-j..k))\, I(w[j..k)), \qquad I(u) = \int_{\frac12 > t_1 > \cdots > t_L > 0} \omega_{u_1}(t_1) \cdots \omega_{u_L}(t_L).

Every suffix of the admissible words ww and w∗w^* ends with x1x_1, so each II is a multiple polylogarithm at 12\tfrac12: for w=x0c1−1x1⋯x0cd−1x1w = x_0^{c_1 - 1} x_1 \cdots x_0^{c_d - 1} x_1 and a suffix starting inside block ii with first entry c′c',

I=Li⁡c′,ci+1,…,cd(12)=∑n≥12−nnc′ Hi+1(n−1),Hi(n)=∑n≥ni>⋯>nd≥1ni−ci⋯nd−cd.I = \operatorname{Li}_{c', c_{i+1}, \ldots, c_d}(\tfrac12) = \sum_{n \ge 1} \frac{2^{-n}}{n^{c'}}\, H_{i+1}(n - 1), \qquad H_i(n) = \sum_{n \ge n_i > \cdots > n_d \ge 1} n_i^{-c_i} \cdots n_d^{-c_d}.

With Gi(n)=2−nHi(n)G_i(n) = 2^{-n} H_i(n) and one accumulator AjA_j per suffix,

Gi(n)=12Gi(n−1)+12n−ciGi+1(n−1),Aj(n)=Aj(n−1)+12n−c′Gi+1(n−1),G_i(n) = \tfrac12 G_i(n-1) + \tfrac12 n^{-c_i} G_{i+1}(n-1), \qquad A_j(n) = A_j(n-1) + \tfrac12 n^{-c'} G_{i+1}(n-1),

a lower triangular linear recurrence X(n)=M(n)X(n−1)X(n) = M(n) X(n-1) of dimension d+kd + k. The matrices 2nCM(n)2 n^{C} M(n), C=max⁡iciC = \max_i c_i, have integer entries; their product over n=1,…,Nn = 1, \ldots, N is computed by binary splitting, exactly at the lower levels and in ball arithmetic at the working precision above, the products for ww and w∗w^* in parallel.

Proposition 4 (Truncation). Each AjA_j omits at most 2−N(1+log⁡(N+1))d/(1−q)2^{-N} (1 + \log(N+1))^d / (1 - q), q=(1+1/N)d/2q = (1 + 1/N)^d / 2, when the products stop at NN.

Proof. Hi(n)≤(∑m≤n1/m)d≤(1+log⁡n)dH_i(n) \le (\sum_{m \le n} 1/m)^{d} \le (1 + \log n)^d, so the tail is at most ∑n>N2−n(1+log⁡n)d\sum_{n > N} 2^{-n} (1 + \log n)^d, and the ratio of consecutive terms is at most qq.

With N≈PN \approx P terms the cost is O(M(P)log⁡2P)O(M(P) \log^2 P) for fixed weight. acb_mzeta_mzv switches to this algorithm from 25000 bits (for weight at most 500), the measured crossover.

Multiple polylogarithms#

Goncharov's iterated integrals [Gon2001]

G(a1,…,aL;z)=∫z>t1>⋯>tL>0dt1t1−a1⋯dtLtL−aL(aL≠0),G(a_1, \ldots, a_L; z) = \int_{z > t_1 > \cdots > t_L > 0} \frac{dt_1}{t_1 - a_1} \cdots \frac{dt_L}{t_L - a_L} \qquad (a_L \ne 0),

along the segment [0,z][0, z], give

Li⁡s1,…,sr(x1,…,xr)=(−1)rG(0s1−1,1/y1,…,0sr−1,1/yr;1),yi=x1⋯xi,\operatorname{Li}_{s_1, \ldots, s_r}(x_1, \ldots, x_r) = (-1)^r G(0^{s_1-1}, 1/y_1, \ldots, 0^{s_r-1}, 1/y_r; 1), \qquad y_i = x_1 \cdots x_i,

which follows by expanding each dt/(t−a)=−a−1∑k(t/a)kdtdt/(t - a) = -a^{-1} \sum_k (t/a)^k dt and integrating term by term.

Power series at 0. Write Fl(t)=G(al,…,aL;t)=∑nfl(n)tnF_l(t) = G(a_l, \ldots, a_L; t) = \sum_n f_l(n) t^n. Then fl(n)=fl+1(n)/nf_l(n) = f_{l+1}(n)/n if al=0a_l = 0, and fl(n)=−Sl(n−1)/(nal)f_l(n) = -S_l(n-1)/(n a_l) with Sl(n)=Sl(n−1)/al+fl+1(n)S_l(n) = S_l(n-1)/a_l + f_{l+1}(n) otherwise. After scaling by znz^n, the values Tl(n)=znSl(n)T_l(n) = z^n S_l(n) for the nonzero letters and the partial sums Al(n)=∑m≤nfl(m)zm→Fl(z)A_l(n) = \sum_{m \le n} f_l(m) z^m \to F_l(z) for all ll satisfy a lower triangular linear recurrence (with gl+1g_{l+1} expanded down to the next nonzero letter). Multiplying the rows by nCn^C, CC one more than the longest run of zeros, the product of the matrices is computed by binary splitting in complex ball arithmetic (exactly while the entries are exact and short). This gives G(al,…,aL;z)G(a_l, \ldots, a_L; z) for all suffixes at once.

Theorem 5 (Truncation). Let RR be the smallest absolute value of a nonzero letter, dd the number of nonzero letters, and q=∣z∣/R<1q = |z|/R < 1. Truncating the series after n=Nn = N changes each Fl(z)F_l(z) by at most

log⁡(N+1)d e (1+1/N) qN+11−q(1+1/N)(q(1+1/N)<1).\log(N+1)^d\, e\, (1 + 1/N)\, \frac{q^{N+1}}{1 - q (1 + 1/N)} \qquad (q (1 + 1/N) < 1).

Proof. The coefficients of −1/(t−a)=a−1∑k(t/a)k-1/(t - a) = a^{-1} \sum_k (t/a)^k are bounded in absolute value by those of 1/(∣a∣−t)1/(|a| - t), and integration preserves coefficientwise majorization, so ∣fl(n)∣≤f~l(n)|f_l(n)| \le \tilde f_l(n), the coefficients of the series F~l\tilde F_l with the letters ∣al∣|a_l|. For 0<ρ<R0 < \rho < R, by induction from F~L+1=1\tilde F_{L+1} = 1: a letter 0 does not increase F~(ρ)\tilde F(\rho) (for a series with nonnegative coefficients vanishing at 0, ∑ncnρn/n≤∑ncnρn\sum_n c_n \rho^n / n \le \sum_n c_n \rho^n), and a nonzero letter bb multiplies it by at most ∫0ρdt/(∣b∣−t)≤log⁡(R/(R−ρ))\int_0^\rho dt/(|b| - t) \le \log(R/(R - \rho)), since F~\tilde F is increasing. Hence F~l(ρ)≤log⁡(R/(R−ρ))d\tilde F_l(\rho) \le \log(R/(R-\rho))^d and, by Cauchy's inequality, ∣fl(n)zn∣≤log⁡(R/(R−ρ))d(∣z∣/ρ)n|f_l(n) z^n| \le \log(R/(R-\rho))^d (|z|/\rho)^n. With ρ=RN/(N+1)\rho = R N/(N+1), log⁡(R/(R−ρ))=log⁡(N+1)\log(R/(R - \rho)) = \log(N+1) and ∣z∣/ρ=q(1+1/N)|z|/\rho = q (1 + 1/N); sum the geometric tail and use (1+1/N)N+1≤e(1+1/N)(1 + 1/N)^{N+1} \le e (1 + 1/N).

Splitting at 12\tfrac12. The series at 1 converges geometrically with ratio 1/R1/R. If R≥2R \ge 2 it is used directly; otherwise, if every nonzero letter aa and every nonzero 1−a1 - a has absolute value at least 34\tfrac34, the path is split at 12\tfrac12 (Chen's formula) and t↦1−tt \mapsto 1 - t is substituted above it:

G(a1,…,aL;1)=∑j=0L(−1)j G(1−aj,…,1−a1;12) G(aj+1,…,aL;12),G(a_1, \ldots, a_L; 1) = \sum_{j=0}^{L} (-1)^j\, G(1 - a_j, \ldots, 1 - a_1; \tfrac12)\, G(a_{j+1}, \ldots, a_L; \tfrac12),

where both families are suffixes of one word (the second of aa, the first of the reversed word 1−aL,…,1−a11 - a_L, \ldots, 1 - a_1), so two binary splitting runs with ratio at most 23\tfrac23 give all the factors. Arguments outside these regions, such as letters close to 12\tfrac12 or points xx outside the unit disk, are not supported.

Colored multiple zeta values. For xi=ζeix_i = \zeta^{e_i} with ζ=e2πi/N\zeta = e^{2\pi i/N}, the partial products yiy_i are formed exactly from the sums of the exponents. The letters 1/yi1/y_i are roots of unity and the letters 1−1/yi1 - 1/y_i have absolute value ∣1−ζj∣≥2sin⁡(π/N)|1 - \zeta^j| \ge 2 \sin(\pi/N) for j≢0j \not\equiv 0, so the split applies for N≤8N \le 8 (with ratio at most 12\tfrac12 for N≤6N \le 6).

Use in FLINT#

Referenced from#

References#

Cite this page

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