Repository navigation
zeta(s), zeta(s, a); gradient, divergence and curl - #2476
Open
Rafael-SOWNet wants to merge 1 commit into
Open
Rafael-SOWNet wants to merge 1 commit into
Rafael-SOWNet wants to merge 1 commit into
Conversation
zeta(s) and zeta(s, a), also riemannzeta(s) and hurwitzzeta(s, a), were refused by name and are now
Entity.Zetaf, built by MathS.Zeta: the Hurwitz zeta function of DLMF 25.11, sum_(n >= 0) 1/(n + a)^s
continued to every s but its pole at 1, with no value at a = 0, -1, -2, ..., and the Riemann one at
a = 1. zeta alone is still a variable and zeta (s) with a space the product zeta * s, as gamma is.
It is exact at s = 0 and the even numbers, zeta(2m) a rational times pi^(2m), and at s = -n, where it
is -B_(n + 1)(a)/(n + 1) for every rational a. At a whole s >= 2 and a whole or half-whole a it is
written in zeta(s), so zeta(3, 1/2) is 7 zeta(3). The pole and a non-positive whole a are NaN.
Elsewhere it is evaluated to the working precision, for real and complex s and a, by the
Euler-Maclaurin formula, summing to w = a + N with w at least 0.4 W + |s|/2 for W working digits.
Digits lost to cancellation, left of 0 or near a zero, are counted and the sum taken again with as
many more, and the Riemann function left of 0 is reflected through Gamma(1 - s). 300 random points,
Riemann and Hurwitz, real and complex, a negative and complex, agree with mpmath to 5e-100 at 100
digits, as does the first zero on the critical line at the decimals written, and zeta(3) to 200
digits.
Its derivative in a is -s zeta(s + 1, a); in s it is left a derivative. It prints as zeta(s) and
zeta(s, a), draws as \operatorname{\zeta}, and exports to sympy.zeta. Neither compiler has it, and
Binders.Refusal names it, so Compile and MathS.Shaders decline it with one message.
gradient(f, x), divergence(F, x) and curl(F, x) are computed into derivatives when parsed, as
jacobian is, in the variables listed as a vector or one name. The gradient and the curl are columns,
and the curl is taken in three variables only. One argument is refused saying to give the
variables: gradient(x^2) and divergence(x) were refused by name, and curl(x) was a product. grad and
div stay variables.
Part of #2182.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2476 +/- ##
==========================================
+ Coverage 86.97% 86.98% +0.01%
==========================================
Files 324 326 +2
Lines 71847 72233 +386
Branches 20953 21037 +84
==========================================
+ Hits 62490 62835 +345
- Misses 5024 5048 +24
- Partials 4333 4350 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The names decided on #2182 (comment of 2026-11-15, edited 2026-11-16): the Riemann and Hurwitz zeta functions, and the gradient, divergence and curl, spelled out.
Zeta
zeta(s)andzeta(s, a), read likegamma, with DLMF 25.11's Hurwitz convention;riemannzeta(s)andhurwitzzeta(s, a)are accepted on input. One node,Zetaf(Argument, Parameter): the Riemann function isa = 1, andzeta(s, 1)prints aszeta(s).zetaalone stays a variable andzeta (s)with a space stayszeta * s, asgamma (s)does.ZetaandHurwitzZetaare not read.a(to n = 300), so ζ(−1) = −1/12 and ζ(−11) = 691/32760; a whole s ≥ 2 with a whole or half-wholeawritten in ζ(s): ζ(2, 3) = π²/6 − 5/4, ζ(3, 1/2) = 7ζ(3). The pole s = 1 and a = 0, −1, −2, … areNaN, asgamma(0)is; the domain condition isnot s = 1 and (not a in ZZ or a > 0).a, real or complex; digits lost to cancellation are counted and the sum is taken again with that many more; the Riemann function left of 0 is reflected through Γ(1 − s) (DLMF 25.4.1). It declines beyond about |s| ≈ 40,000.areal in [−6, 6] and complex) at 100 digits, worst relative error 4.9e-100. ζ(1/2 + 14.134725141734693790457251983562i) agrees with mpmath at 200 digits to all 100; ζ(−60.5, 0.7) to all 100 (mpmath at its default precision is wrong there).derivativenode. Printszeta(s); LaTeX\operatorname{\zeta}\left(s\right)by the register's rule for a Greek letter that could be a variable (asphiis\operatorname{\varphi}); SymPysympy.zeta(s, a). Not compiled (no sound algorithm over double); the refusal goes throughBinders.Refusal, soMathS.Shadersdeclines with the same message.The gradient, divergence and curl
gradient(f, [x, y, z])divergence(F, [x, y, z])curl(F, [x, y, z])[∂F₃/∂y − ∂F₂/∂z, ∂F₁/∂z − ∂F₃/∂x, ∂F₂/∂x − ∂F₁/∂y]jacobiantakes themcurlwith other than 3 variables, or a field of the wrong lengthInvalidArgumentParseExceptionat parse time, ascrossdoesgradient(x^2),divergence(x),curl(F)FunctionArgumentCountException, saying to give the variablesgrad(f, x),div(F, x)grad,div,curlalone stay variablesChecked against the definitions and against
jacobian(the gradient is its transposed row, the divergence its trace, the curl from its off-diagonal entries); div curl F = 0 and curl grad f = 0 hold at negative and complex sample points.Records
BREAKING-CHANGES.md, measured on the 2.7.0 package: the zeta names threwUnrecognizedFunctionParseException;gradient(x^2),divergence(x)andcurl(x)were products; the two-argument operators were parse errors.curl(x)becoming a refusal follows #2453's treatment ofgradientanddivergence: a name in the register does not read as a product. The grammar adds the six names and removes the five refusals; master's grammar was regenerated unchanged first and matched byte for byte.Full check on this commit: 20,736 unit tests, 0 failed; MCP 450, Terminal 69, F# 134, Interactive 19; AOT 81/81; BoundCheck 0 disagreements, RootCheck 596/596, CasBench 120/121 with 0 wrong, SimpSweep 10463/10463, RuleCheck clean, CanonCheck and Confluence at their baselines.
Not in this PR: limits through zeta stay unevaluated, there are no integration rules for it, and Comparison.md (a measured table) updates on the next
sympyparityrun.Closes #2182.
🤖 Generated with Claude Code