Skip to content

Fix ligamma where tgamma(a, x) is near 1 - #1518

Merged
NAThompson merged 2 commits into
developfrom
ligamma-near-one
Oct 10, 2026
Merged

NAThompson merged 2 commits into
developfrom
ligamma-near-one

Conversation

@NAThompson

Copy link
Copy Markdown
Collaborator

For a < 2 and x < 1.1, form tgamma(a, x) - 1 from tgamma_small_upper_part's terms and take log1p, and elsewhere avoid log(value) near 1; also fix the -Wnarrowing warnings that filled the autodiff CI log. Closes #1514.

develop vs this PR, |ulps| / envelope:

ligamma
ligamma_lower

🤖 Generated with Claude Code

For a < 2 and x < 1.1, form tgamma(a, x) - 1 from tgamma_small_upper_part's terms and take log1p, and elsewhere avoid log(value) near 1; also fix the -Wnarrowing warnings that filled the autodiff CI log. Closes #1514.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oted

MSVC's long double is double, so double is evaluated in double there, and
ligamma(0.1875, 0.09375) is 6 ulps off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cv9iuQnFqA3mVDEbMxNnjh
@NAThompson
NAThompson merged commit 69e1645 into develop Oct 10, 2026
48 checks passed
@NAThompson
NAThompson deleted the ligamma-near-one branch October 10, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ligamma loses accuracy where tgamma(a, x) is near 1

2 participants