You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit db5573d
Browse filesBrowse the repository at this point in the historyBrowse files
The polygamma functions, and the derivative of the factorial (#2068)
* The polygamma functions, and the derivative of the factorial
polygamma(n, z) is psi^(n)(z), the (n + 1)-th derivative of ln Gamma(z),
and digamma(z) is polygamma(0, z) and prints so. Both are parsed and
printed in text, LaTeX and SymPy; neither name was recognised, so
digamma(1) was the variable digamma, and polygamma(1, 1) did not parse.
Each order differentiates to the next, and an order that depends on the
variable declines. The derivative of x! is x! digamma(x + 1), where it
declined (#958), so gamma(x) differentiates to (x - 1)! digamma(x).
It is evaluated to the working precision anywhere in the complex plane
but at 0, -1, -2, ..., its poles: reflected left of Re z = 1/2 (DLMF
5.15.6), with the derivatives of cot(pi z) as polynomials in cot; moved by
the recurrence (5.15.5) to Re w at least the working digits; and summed by
the asymptotic series (5.11.2, 5.15.8), with the Bernoulli numbers exact
from the tangent numbers by Brent and Harvey's recurrence. It agrees with
mpmath to the last digit at 100, 300 and 2000 digits. Special values stay
as written, since digamma(1) = -gamma wants a symbol for Euler's constant.
Two derivative tests used the factorial as the node that cannot be
differentiated; they use a polygamma function of a varying order.
Part of #171.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
* Name the polygamma functions in the MCP server's syntax resource
The server's syntax document lists every function the grammar reads, and
its test fails on a name the grammar accepts that the document does not.
Part of #171.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: BREAKING-CHANGES.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,21 @@ as `a - b = 0`, as a statement's own solve reads it: `"x + 1 = 3".Solve("x")` wa
97
97
| `MathS.Equations("x + y = 3", "x - y = 1").Solve("x", "y")` | `null` | `[[2, 1]]` |
98
98
| `MathS.Equations("x + y = 3", "x - y = 1").ToString()` | `x + y = 3 = 0` and `x - y = 1 = 0` | `x + y - 3 = 0` and `x - y - 1 = 0` |
99
99
100
+
### The polygamma functions, and the derivative of the factorial
101
+
102
+
**Silent: a new reading, and an answer where there was none.**
103
+
- **New functions.** `polygamma(n, z)` and `digamma(z)` are the polygamma functions `psi^(n)(z)`, the `(n + 1)`-th derivatives of `ln Gamma(z)`, and the digamma function, which is `polygamma(0, z)`. Neither name was recognised, so each was read as a product with an undeclared variable.
104
+
- **Evaluation.** Each is evaluated to the working precision anywhere in the complex plane but at `0, -1, -2, ...`, its poles, where it is `NaN`.
105
+
- **Derivatives.** Each order differentiates to the next. The derivative of `x!`, which was left unevaluated, is `x! * digamma(x + 1)` ([#171](https://github.com/asc-community/AngouriMath/issues/171)).
106
+
107
+
| Input | Was (2.6.0) | Now |
108
+
|---|---|---|
109
+
| `"digamma(1)".ToEntity()` | `digamma * 1`, the variable `digamma` | `digamma(1)`, which evaluates to `-0.5772156649015328…` |
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n
file_header_template=\nCopyright (c) 2019-2026 Angouri.\nAngouriMath is licensed under MIT.\nDetails: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.\nWebsite: https://am.angouri.org.\n
0 commit comments