Skip to content

Fix pbdv for large arguments - #255

Open
verma-divyanshu-git wants to merge 2 commits into
scipy:mainfrom
verma-divyanshu-git:fix-pbdv-negative-arguments
Open

Fix pbdv for large arguments#255
verma-divyanshu-git wants to merge 2 commits into
scipy:mainfrom
verma-divyanshu-git:fix-pbdv-negative-arguments

Conversation

@verma-divyanshu-git

@verma-divyanshu-git verma-divyanshu-git commented Aug 19, 2026

Copy link
Copy Markdown

Summary

  • use the accurate gamma and trigonometric helpers near integer orders
  • use the connection formula where the forward recurrence loses accuracy
  • avoid premature underflow when normalizing the backward recurrence
  • add regression coverage for the reported large-argument failures

Addresses scipy/scipy#25814.

Tests

  • pixi run tests
  • pixi run format-dry-error

AI disclosure

I used AI assistance to understand the repository structure and generate an initial draft of the potential fix and regression tests.
The initial drafts of v small parts of include/xsf/par_cyl.h and tests/scipy_special_tests/test_pbdv.cpp were AI-assisted.
I reproduced the reported failures, traced the two numerical root causes, revised the implementation based on my own understanding, verified the reference values against mpmath, and ran the full test and formatting checks.
I reviewed the final code and take responsibility for it.

@verma-divyanshu-git

verma-divyanshu-git commented Aug 19, 2026

Copy link
Copy Markdown
Author

@lucascolley, could you please take a look when you have time? this is the xsf fix for scipy/scipy#25814, and the scipy PR depends on it. thanks.

@verma-divyanshu-git

verma-divyanshu-git commented Aug 23, 2026

Copy link
Copy Markdown
Author

@lucascolley @steppi @j-bowhay, could one of you please review this when you have time? scipy/scipy#25966 is waiting on this change. the branch is mergeable, the full xsf suite passes (410 tests), and the scipy.special suite passes (8,769 tests). i'm happy to address any changes, if needed.

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.

1 participant