Skip to content

A binomial at a pole of its denominator is zero - #2212

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
a-binomial-at-a-pole-of-its-denominator-is-zero
Oct 29, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
a-binomial-at-a-pole-of-its-denominator-is-zero

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

binomial(n, k) with a k that is not whole, where n - k is a negative whole number, was left as written. Γ(n - k + 1) in the denominator has a pole there, and the evaluation gave up on the NaN it computed for it. The reciprocal gamma is 0 at a pole, so the binomial is 0, as mpmath has it and as the node's domain condition already allows.

A whole k is not taken by the new case: binomial(-3, k) for a whole k too large to multiply out is not 0, and stays as written.

2.6.0 now
"binomial(1/2, 3/2)".ToEntity().Simplify() binomial(1/2, 3/2) 0
"binomial(1/2, 3/2)".ToEntity().EvalNumerical() CannotEvalException 0

Found beside #2211 while measuring evaluation for #2195's compiled forms; the entry is #2211's, extended.

Tests: AtAPoleOfTheDenominatorItIsZero, exactly and numerically, at (1/2, 3/2), (5/2, 7/2), (1/2, 5/2) and (3/2 + i, 5/2 + i). Full suite 17929/0, interactive trio, AOT smoke 67/0, all frameworks build.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

binomial(n, k) with a k that is not whole, where n - k is a negative
whole number, was left as written: Γ(n - k + 1) in the denominator has
a pole there, and the evaluation gave up on the NaN it computed. The
reciprocal gamma is 0 at a pole, so the binomial is 0, as mpmath has
it: binomial(1/2, 3/2), binomial(5/2, 7/2) and binomial(3/2 + i, 5/2 + i)
are 0. A whole k is not taken here, where binomial(-3, k) is not 0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Oct 29, 2026
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.57%. Comparing base (f3272dc) to head (658cfcc).

Files with missing lines Patch % Lines
...nuous/Evaluation.Continuous.Arithmetics.Classes.cs 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2212   +/-   ##
=======================================
  Coverage   86.57%   86.57%           
=======================================
  Files         302      302           
  Lines       67056    67059    +3     
  Branches    19471    19472    +1     
=======================================
+ Hits        58054    58058    +4     
+ Misses       4899     4896    -3     
- Partials     4103     4105    +2     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.13% <66.66%> (+<0.01%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 40.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nuous/Evaluation.Continuous.Arithmetics.Classes.cs 86.58% <66.66%> (-0.08%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rafael-SOWNet
Rafael-SOWNet merged commit e59e609 into master Oct 29, 2026
35 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the a-binomial-at-a-pole-of-its-denominator-is-zero branch October 29, 2026 22:55
@github-project-automation github-project-automation Bot moved this from In review to Done in AngouriMath Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant