Repository navigation
Add a dev-only nanobind Python layer and the beta distribution's entropy - #1563
Merged
Merged
Conversation
NAThompson
force-pushed
the
python-dev-layer
branch
from
October 12, 2026 03:59
47ff092 to
1ceffae
Compare
nanobind/ bindings (not built by CI); entropy(beta_distribution) via Stirling and zeta series; libeta, ligamma and lbeta return an exact -inf instead of raising; x87 tolerance in test_lanczos_smoothing. Closes #1508 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NAThompson
force-pushed
the
python-dev-layer
branch
from
October 12, 2026 04:44
1ceffae to
db9307e
Compare
This was referenced Oct 12, 2026
Closed
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.
nanobind/ bindings (not built by CI); entropy(beta_distribution) via Stirling and zeta series; libeta, ligamma and lbeta return an exact -inf instead of raising; x87 tolerance in test_lanczos_smoothing.
Closes #1508
entropy(beta_distribution)
The textbook form log B(α, β) − (α−1)ψ(α) − (β−1)ψ(β) + (α+β−2)ψ(α+β) cancels catastrophically. For large α or β the terms grow like α log α while H only grows like log α, and near α = β = 1 the terms are first order while H is second order.
Against mpmath at 40 digits on a 500 × 500 log grid, double precision, the median error is 0.63 ulps and the maximum 110. The maximum is at 1 ≲ α, β ≲ 10, where neither series applies. The textbook form reaches 5.3·10⁶ ulps.
cpp_bin_float_50 gives 0.03 to 21 eps at the test points.
🤖 Generated with Claude Code