FLINT3.7.0-dev
Algorithm

The dilogarithm

Cost
O(M(p) log² p) at p bits with the bit-burst algorithm; O(p^{1/2}) full multiplications with rectangular splitting at moderate precision.

The dilogarithm

Li⁡2(z)=−∫0zlog⁡(1−t)t dt=∑k=1∞zkk2=z 3F2(1,1,1;2,2;z)\operatorname{Li}_2(z) = -\int_0^z \frac{\log(1-t)}{t}\,dt = \sum_{k=1}^\infty \frac{z^k}{k^2} = z\,{}_3F_2(1,1,1;2,2;z)

is analytic on C∖[1,∞)\mathbb{C} \setminus [1, \infty). acb_hypgeom_dilog evaluates it for complex balls; it is a holonomic function, and the methods below are instances of the general ones in Hypergeometric functions. General polylogarithms Li⁡s(z)\operatorname{Li}_s(z) are computed in acb_dirichlet and acb_poly by other methods (Zeta functions, polylogarithms and L-functions).

Transformations#

The functional equations

Li⁡2(z)=−Li⁡2(1/z)−12log⁡2(−z)−π26(z∉(0,1)),\operatorname{Li}_2(z) = -\operatorname{Li}_2(1/z) - \tfrac12\log^2(-z) - \tfrac{\pi^2}{6} \quad (z \notin (0,1)),
Li⁡2(z)=−Li⁡2(1−z)−log⁡(1−z)log⁡(z)+π26,\operatorname{Li}_2(z) = -\operatorname{Li}_2(1-z) - \log(1-z)\log(z) + \tfrac{\pi^2}{6},
Li⁡2(z)=−Li⁡2(zz−1)−12log⁡2(1−z)(z∉(1,∞)),\operatorname{Li}_2(z) = -\operatorname{Li}_2\left(\tfrac{z}{z-1}\right) - \tfrac12\log^2(1-z) \quad (z \notin (1, \infty)),
Li⁡2(z)=Li⁡2(11−z)+log⁡(1−z)[12log⁡(1−z)−log⁡(−z)]−π26\operatorname{Li}_2(z) = \operatorname{Li}_2\left(\tfrac{1}{1-z}\right) + \log(1-z)\left[\tfrac12\log(1-z) - \log(-z)\right] - \tfrac{\pi^2}{6}

map zz to 1/z1/z, 1−z1 - z, z/(z−1)z/(z-1) and 1/(1−z)1/(1-z) (acb_hypgeom_dilog_transform with algorithm 1 to 4; each returns an indeterminate result if the ball meets the region where the formula is invalid). As for 2F1{}_2F_1, the union of the disks ∣w∣≤r|w| \le r over the transformed arguments ww covers the plane except neighbourhoods of the points e±πi/3e^{\pm\pi i/3}, which are fixed points of the transformation group.

acb_hypgeom_dilog computes ∣z∣2|z|^2, ∣1/z∣2|1/z|^2, ∣1−z∣2|1-z|^2, ∣z/(z−1)∣2|z/(z-1)|^2 and ∣1/(1−z)∣2|1/(1-z)|^2 in double precision and uses the series at 0 directly if ∣z∣≤1/4|z| \le 1/4, and otherwise after the transformation that minimizes ∣w∣|w|. If the best ∣w∣|w| is still above 1/41/4, it considers two alternatives:

  • below 10000 bits, the series in log⁡z\log z described next, if its rate of convergence ∣log⁡z/(2π)∣|\log z/(2\pi)| (with a penalty factor) is better;
  • if the best ∣w∣|w| exceeds 3/43/4 (which happens only near e±πi/3e^{\pm\pi i/3} when the Bernoulli series was not chosen), expansion at one of the points ii, (1+i)/2(1+i)/2, 1+i1+i (or their conjugates), where Li⁡2\operatorname{Li}_2 has a closed form, for example Li⁡2(i)=−π2/48+iG\operatorname{Li}_2(i) = -\pi^2/48 + iG with Catalan's constant GG, followed by bit-burst continuation to zz.

The working precision is limited to the accuracy of the input plus 30 bits, and raised by 0.5% plus 5 bits.

The series at zero#

acb_hypgeom_dilog_zero_taylor sums ∑k≥1zk/k2\sum_{k \ge 1} z^k/k^2 for small ∣z∣|z|. Since the coefficients are reciprocals of small integers, the sum is computed by rectangular splitting in powers of zz, where several consecutive denominators k2k^2 are combined into one word-size divisor, or by binary splitting when zz has few bits; the tail after nn terms is bounded by ∣z∣n/(1−∣z∣)|z|^n/(1-|z|). acb_hypgeom_dilog_zero uses this below 40000 bits or for tiny ∣z∣|z|, and the bit-burst algorithm otherwise.

The series in log z#

With w=log⁡zw = \log z, for ∣w∣<2π|w| < 2\pi,

Li⁡2(ew)=π26+w(1−log⁡(−w))−w24−∑k≥3, k oddBk−1(k−1) k!wk,\operatorname{Li}_2(e^w) = \frac{\pi^2}{6} + w(1 - \log(-w)) - \frac{w^2}{4} - \sum_{k \ge 3,\ k \text{ odd}} \frac{B_{k-1}}{(k-1)\,k!} w^k,

which follows from Li⁡2(ew)=ζ(2)+w(1−log⁡(−w))+∑k≥2ζ(2−k)wk/k!\operatorname{Li}_2(e^w) = \zeta(2) + w(1 - \log(-w)) + \sum_{k \ge 2} \zeta(2-k) w^k/k! and ζ(2−k)=−Bk−1/(k−1)\zeta(2-k) = -B_{k-1}/(k-1). For k≥4k \ge 4 the terms are bounded by (∣w∣/(2π))k(|w|/(2\pi))^k, which gives the truncation bound as a geometric series. acb_hypgeom_dilog_bernoulli evaluates this with Horner's scheme in w2w^2 and the cached Bernoulli numbers. Near z=e±πi/3z = e^{\pm\pi i/3}, ∣w∣≈π/3|w| \approx \pi/3 and each term gains about 2.6 bits. Since the Bernoulli numbers grow in size, the method is used only below 10000 bits.

Taylor continuation#

acb_hypgeom_dilog_continuation computes Li⁡2(z)−Li⁡2(a)\operatorname{Li}_2(z) - \operatorname{Li}_2(a) from the Taylor expansion at aa. Since ddzLi⁡2(z)=−log⁡(1−z)/z\frac{d}{dz}\operatorname{Li}_2(z) = -\log(1-z)/z, the Taylor coefficients ckc_k satisfy a recurrence of order 2 with polynomial coefficients in kk, aa and a−1a - 1, so the partial sums are products of 3×33 \times 3 matrices, computed with the forward recurrence or by binary splitting. The coefficients are bounded by

∣ck∣≤1+∣log⁡(1−a)∣min⁡(∣a∣,∣1−a∣)k,|c_k| \le \frac{1 + |\log(1-a)|}{\min(|a|, |1-a|)^k},

which follows from the symbolic derivatives, or by ∣ck∣≤4/∣1−a∣k|c_k| \le 4/|1-a|^k for ∣a∣≤1/2|a| \le 1/2 and a=±ia = \pm i (from Cauchy's integral formula); the tail after nn terms is then bounded by a geometric series in ∣z−a∣/min⁡(∣a∣,∣1−a∣)|z - a|/\min(|a|, |1-a|), which must be less than 1. If the segment from aa to zz crosses the branch cut, the result is the analytic continuation along the segment.

The bit-burst algorithm#

For a full-precision zz, the Taylor series at aa needs O(p)O(p) terms with full-precision coefficients. acb_hypgeom_dilog_bitburst (The bit-burst algorithm) instead chooses z0z_0 as zz truncated to 16 fractional bits and the points zjz_j as zz truncated to 2j+42^{j+4} bits, and sums

Li⁡2(z)−Li⁡2(z0)=∑j(Li⁡2(zj+1)−Li⁡2(zj)),\operatorname{Li}_2(z) - \operatorname{Li}_2(z_0) = \sum_{j} \left(\operatorname{Li}_2(z_{j+1}) - \operatorname{Li}_2(z_j)\right),

each term by Taylor continuation from zjz_j with binary splitting: the argument zj+1−zjz_{j+1} - z_j is small and short, so each step costs O(M(p)log⁡p)O(M(p)\log p) and the total O(M(p)log⁡2p)O(M(p)\log^2 p). The value Li⁡2(z0)\operatorname{Li}_2(z_0) comes from the series at 0 (or from a continuation from a special point), and since z0z_0 has only 16 bits it is cheap. If the path would come close to the branch cut, the bit-burst step is skipped.

Use in FLINT#

Referenced from#

Cite this page

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