Repository navigation
The names of functions to come are refused by name - #2184
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2184 +/- ##
==========================================
+ Coverage 86.47% 86.53% +0.06%
==========================================
Files 297 297
Lines 65603 66096 +493
Branches 19227 19227
==========================================
+ Hits 56730 57197 +467
- Misses 4810 4836 +26
Partials 4063 4063
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
marked this pull request as draft
October 28, 2026 15:40
Member
Author
|
Back to draft: the names it reserves wait for #2182's register to settle, which Happypig375 rightly found arbitrary. It will be redone from the settled table. 🤖 Generated with Claude Code |
An unknown name followed by a bracket is read as a product, so zeta(2) was zeta * 2 and simplified to 2 * zeta, silently. #2182 registers the functions the library is to have, named by what a mathematician calls them, and their long names are now refused until each is implemented, as trunc is: zeta, riemannzeta and hurwitzzeta, lambertw and productlog, mobius and moebiusmu, divisorsigma, primenu, primeomega, primepi, harmonicnumber, catalannumber, multinomial, fallingfactorial and factorialpower, risingfactorial, forwarddifference, laplacian, jacobian and hessian. Names that will not be functions are refused with the spelling to use, as NN is with ZZ+ and ZZ*. heaviside's value at 0 is 0, 1/2 or 1 by source, so it points to iverson(x > 0), iverson(x >= 0) and (1 + sgn(x))/2, and unitstep to iverson(x >= 0). isprime(n) is n in PP, fractionalpart(x) is x mod 1, quotient(a, b) is floor(a / b), the double factorial is to be the postfix n!!, and pochhammer is the rising factorial to some authors and the falling one to others. Each name without a bracket is still a variable, and short names such as beta and norm are still read as products. Part of #2182. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet
force-pushed
the
the-names-of-functions-to-come-are-refused
branch
from
October 28, 2026 18:14
97243eb to
2af815c
Compare
Rafael-SOWNet
marked this pull request as ready for review
October 28, 2026 18:14
This was referenced Oct 28, 2026
Rafael-SOWNet
added a commit
that referenced
this pull request
Oct 28, 2026
laplacian, jacobian and hessian were reserved by name in #2184 and are now computed when they are parsed, as det is. Each is made of derivative nodes and needs no node of its own. laplacian(f, [x, y, z]) is the sum of the second derivatives of a scalar f. jacobian(F, [x, y]) is the matrix of the first derivatives of F's components, with a row for each component and a column for each variable; a scalar F is one row. hessian(f, [x, y]) is the matrix of the second derivatives of a scalar f, the entry in row i and column j being the derivative in x_i of the derivative in x_j, as the definition writes it. The variables are a vector of distinct names written out, or a single name. A set is refused, having no order to give the columns, and so are a constant, a repeated name, and a vector or matrix as the function of a Laplacian or a Hessian. det(jacobian([r cos(t), r sin(t)], [r, t])) simplifies to r, and the Laplacian of 1/r vanishes in space. The syntax page and the MCP server's syntax document describe them, and the native smoke test evaluates two of them. Part of #2182. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet
added a commit
that referenced
this pull request
Oct 28, 2026
laplacian, jacobian and hessian were reserved by name in #2184 and are now computed when they are parsed, as det is. Each is made of derivative nodes and needs no node of its own. laplacian(f, [x, y, z]) is the sum of the second derivatives of a scalar f. jacobian(F, [x, y]) is the matrix of the first derivatives of F's components, with a row for each component and a column for each variable; a scalar F is one row. hessian(f, [x, y]) is the matrix of the second derivatives of a scalar f, the entry in row i and column j being the derivative in x_i of the derivative in x_j, as the definition writes it. The variables are a vector of distinct names written out, or a single name. A set is refused, having no order to give the columns, and so are a constant, a repeated name, and a vector or matrix as the function of a Laplacian or a Hessian. det(jacobian([r cos(t), r sin(t)], [r, t])) simplifies to r, and the Laplacian of 1/r vanishes in space. The syntax page and the MCP server's syntax document describe them, and the native smoke test evaluates two of them. Part of #2182. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet
added a commit
that referenced
this pull request
Oct 29, 2026
fallingfactorial(x, n), also factorialpower(x, n), Mathematica's name, and risingfactorial(x, n) were reserved by name in #2184 and are now Entity.FallingFactorialf and Entity.RisingFactorialf, built by MathS.FallingFactorial and MathS.RisingFactorial. For a whole n >= 0 they are x (x - 1) ... (x - n + 1) and x (x + 1) ... (x + n - 1), x to the n falling and rising, computed exactly for any number x. For a negative whole n they are the reciprocals of (x + 1) ... (x - n) and (x - 1) ... (x + n), (2.52) in Graham, Knuth and Patashnik's Concrete Mathematics, with no value where a factor vanishes. For any other n they are Gamma(x + 1)/Gamma(x - n + 1) and Gamma(x + n)/Gamma(x), as Mathematica's FactorialPower and Pochhammer are, evaluated numerically: no value at a pole of the numerator, and 0 at one of the denominator. fallingfactorial(5, 1/2) agrees with mpmath to 1e-20. risingfactorial(x, n) is fallingfactorial(x + n - 1, n), and binomial(n, k) is fallingfactorial(n, k)/k!. They draw with Knuth's bars, x^{\underline{n}} and x^{\overline{n}}, and export to SymPy's ff and rf. A conjugate as the whole exponent of a power is drawn in brackets, x^{\left(\overline{n}\right)}, since x^{\overline{n}} is the rising factorial. pochhammer stays refused, (x)_n being the rising factorial to some authors and the falling one to others. Part of #2182. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Rafael-SOWNet
added a commit
that referenced
this pull request
Oct 29, 2026
multinomial(k_1, ..., k_m) was reserved by name in #2184. It is now (k_1 + ... + k_m)! / (k_1! ... k_m!), written so when it is parsed, as Happypig375 agreed on #2182. The factorial is the gamma function off the whole numbers, so the coefficient is symmetric in its arguments everywhere, and it has no value where an argument or their sum is a negative integer, a pole of the gamma function. multinomial(2, 3, 4) is 1260, multinomial(1/2, 1/2) is 4 / pi, and multinomial(1/2, 1/3) agrees with mpmath to 1e-25. It is not built as the product of binomial coefficients the multinomial theorem factors it into. binomial is 0 at a negative whole lower index, and that product depends on the order of the arguments there: multinomial(-3, 1) would be -2 and multinomial(1, -3) would be 0. Part of #2182. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
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.
An unknown name followed by a bracket is read as a product, so
zeta(2)waszeta * 2and simplified to2 * zeta, with nothing said. #2182 registers the functions the library is to have, named by what a mathematician calls them. Reworked with Happypig375 there, it is reserved here in two kinds.Functions to come, refused until each is implemented, as
truncalready is:zeta,riemannzeta,hurwitzzeta. All three are reserved, sincezeta(s)must not stay a product whichever name A register of function names, by what a mathematician calls each #2182 settles on.lambertwand Mathematica'sproductlog.mobiusandmoebiusmu,divisorsigma,primenu,primeomega,primepi.harmonicnumber,catalannumber,multinomial.fallingfactorialandfactorialpower,risingfactorial.forwarddifference,laplacian,jacobian,hessian.Names that will not be functions, refused with the spelling to use, as
NNis refused withZZ+andZZ*:heaviside0,1/2or1by sourceiverson(x > 0),iverson(x >= 0)or(1 + sgn(x))/2unitstepiverson(x >= 0)isprimen in PPis the statementn in PPfractionalpartx mod 1quotientfloor(a / b)doublefactorial,factorial2n!!pochhammerrisingfactorialorfallingfactorialEach name without a bracket is still a variable. Short names that could be somebody's variable before a bracket are not reserved:
beta,norm,grad,div,curl.Docs/Usage/Syntax.md's "Refused by name" paragraph lists both kinds, and so does the MCP server's syntax document. The parser is regenerated.zeta(s)zeta * sUnrecognizedFunctionParseExceptionzeta(2), simplified2 * zetaUnrecognizedFunctionParseExceptionisprime(7)isprime * 7n in PPheaviside(x)heaviside * xdivisorsigma(k, n)UnhandledParseExceptionUnrecognizedFunctionParseExceptionMeasured, on the branch before its rebase onto #2186's merge, which shares only
BREAKING-CHANGES.mdwith it, at a different entry, and none of its code:Part of #2182.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura