Skip to content

PolyLog(s, 1) is Zeta(s) only for Re s > 1, a complex infinity for Re s <= 1 - #681

Closed
enumeratio wants to merge 1 commit into
cortex-js:mainfrom
enumeratio:polylog-at-one-diverges
Closed

enumeratio wants to merge 1 commit into
cortex-js:mainfrom
enumeratio:polylog-at-one-diverges

Conversation

@enumeratio

Copy link
Copy Markdown
Contributor

Liₛ(z) ~ Γ(1 − s)(−ln z)ˢ⁻¹ as z → 1, so Liₛ(1) = ζ(s) only where the series converges, Re s > 1; below it the value diverges (on Re s = 1 there is no limit). PolyLog answered Zeta(s) for every order.

  • polylogReduce (library/special-functions.ts): at z = 1, a number order gives Zeta(s) for Re s > 1 and ComplexInfinity otherwise (PolyLog(1, 1) stays +∞). A symbolic order gives Zeta(s) only when s > 1 is proved, else stays unevaluated.
  • Numeric kernel (numerics/polylog.ts): polylogOrderComplex and polylogOrderReal return Infinity at z = 1 for Re s <= 1, as they do for the orders 1, 0 and −1; polylogIntegerOrderComplex no longer gives ζ(n) for n ≤ −2.
  • Compiled JS: the above kernels. Compiled GLSL: _gpu_ir_poly_log and _gpu_ir_cpolylog give +inf at z = 1 for Re s <= 1; the f32 model in the test helpers matches.

Before and after: PolyLog(-1/2, 1) was -0.2079, PolyLog(0.5, 1) -1.4604, PolyLog(-4.038, 1) -0.000299, PolyLog(0.5+2i, 1) 0.4405-0.3116i, PolyLog(1+2i, 1) Zeta(1+2i); all are now ComplexInfinity. PolyLog(1.5, 1), PolyLog(2, 1) (π²/6) and PolyLog(3+i, 1) are unchanged.

Tests (test/compute-engine/polylog-at-one.test.ts): the values above, the Re s > 1 controls, the integer poles unchanged, a symbolic order (unevaluated; Zeta(t) under t > 1), and evaluate(), .N() and compiled JS agreeing for real orders at z = 1.

Fixes #680

… Re s <= 1, on evaluate, N() and the compiled JS and GLSL code; a symbolic order stays unevaluated (cortex-js#680)
@enumeratio
enumeratio force-pushed the polylog-at-one-diverges branch from b511ce7 to 8533c5f Compare December 3, 2026 00:27
arnog added a commit that referenced this pull request Dec 3, 2026
… a flattened (a - Mod(a, c))/c, Floor of an integer and (-1)^j; PolyLog(s, 1) is Zeta(s) only for Re s > 1

- #677 (#676): in the bigint compile mode, Floor(a/b) of two integers is
  the floor division; (a - Mod(a, c))/c is recognized when the canonical
  form flattens a sum a around the Mod term; Floor, Ceil, Round and
  Truncate of an integer are the integer; (-1)^j of an integer j is
  1 - 2 Mod(j, 2). Power(2, n) still declines.
- #681 (#680): PolyLog(s, 1) is Zeta(s) for Re s > 1 and a complex
  infinity for Re s < 1, in the interpreter, the numeric kernel and the
  GLSL helpers. A symbolic order not known to exceed 1 stays unevaluated.

Review fixes: on Re s = 1, s != 1, PolyLog(s, 1) is bounded with no limit,
so it stays unevaluated (NaN in compiled code) instead of a complex
infinity; a real order is compared with 1 exactly, not as a double; a
complex order with Re s < 1 gives the unsigned pole in compiled
JavaScript; the GLSL LerchPhi helper tests z = 1 before its route through
PolyLog, so LerchPhi(1, s, 1) keeps the value Zeta(s); flooredQuotient
lowers the dividend of the Mod, a node of the program; the unreachable
z = 1 branches of polylogIntegerOrderComplex are removed.

Co-authored-by: enumeratio <314378874+enumeratio@users.noreply.github.com>
@arnog

arnog commented Dec 3, 2026

Copy link
Copy Markdown
Member

Landed in adae37a, with one change: on Re s = 1, s != 1, PolyLog(s, 1) stays unevaluated, because the function is bounded there and has no limit. Thank you.

@arnog arnog closed this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PolyLog(s, 1) answers Zeta(s) for every order, but Li_s(1) diverges for Re s <= 1

2 participants