Skip to content

DedekindEta at a complex τ at the working precision - #561

Open
enumeratio wants to merge 1 commit into
cortex-js:mainfrom
enumeratio:dedekind-eta-bignum
Open

enumeratio wants to merge 1 commit into
cortex-js:mainfrom
enumeratio:dedekind-eta-bignum

Conversation

@enumeratio

Copy link
Copy Markdown
Contributor

Fixes #555

For Im τ ≥ 10^-3 above machine precision, numerics/dedekind-eta-big.ts:

  • moves τ into the fundamental domain with η(τ+1) = e^{iπ/12}η(τ) and η(−1/τ) = √(−iτ)η(τ) (DLMF 23.15.1–2): the shift count is kept as an exact integer mod 24, so any Re τ is exact, and the √ factors as a complex product; the digits that an inversion at |τ| < 1 costs (1/|τ|² on the absolute error of τ) are counted and added to the working precision, up to a named cap;
  • sums Euler's pentagonal series e^{iπτ/12} Σ (−1)^k q^{k(3k−1)/2}; its exponents are distinct, so the tail from exponent N is at most |q|^N/(1−|q|) and N is chosen from that bound (no convergence heuristic).
  • A complex value is carried as two big decimals (_inexactNumericValue({re, im}), as applyOnImaginaryAxis does), so nothing is padded or truncated to doubles.
  • Floor: ETA_BIG_MIN_IMAGINARY = 1e-3. Below it the call stays unevaluated at these precisions; the reductions were measured only down to there. Other caps (named): 500 modular steps, 2,000 extra digits, 20,000 for the q exponent.
  • Real τ, Im τ ≤ 0 and machine precision keep the double kernel; evaluate() leaves exact operands exact.

Accuracy against mpmath 1.3.0 (reference: the pentagonal sum evaluated directly, no reduction, at raised digits; it agrees with mpmath's eta to 5e-94 where that converges) on 110 cases at each precision (Re τ in 0, 0.3, −0.5, 0.25, 1/3, 12.7, 10^5 + 0.123456789, 10^20, −7.99999, 0.4999999999999, 0.001; Im τ in 0.001 to 100), error relative to |η|, in units of 10^−(p−1):

p=30 p=50 p=100
0.35 0.41 0.46

No decline in the grid. The slowest case took 19 ms (100 digits).

…g precision (modular reduction, pentagonal sum with a tail bound); below the floor it stays unevaluated

Fixes cortex-js#555
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.

DedekindEta answers N(x, d) with a double's digits

1 participant