Repository navigation
feat: add math/base/special/chebyshev-u-polynomial - #17005
Open
anshurajbisoyi98-ctrl wants to merge 1 commit into
Open
anshurajbisoyi98-ctrl wants to merge 1 commit into
anshurajbisoyi98-ctrl wants to merge 1 commit into
Conversation
Signed-off-by: anshurajbisoyi98-ctrl <anshurajbisoyi98@gmail.com>
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This branch has not been deployed
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.
Description
This pull request:
@stdlib/math/base/special/chebyshev-u-polynomial, which evaluates a Chebyshev polynomial of the second kind.For integer
nit uses the three-term recurrence, like SciPy'seval_chebyu, withU_{-n}(x) = -U_{n-2}(x)for negative degrees. Non-integernis defined through the hypergeometric function, as in the issue, but I evaluate it with the equivalent closed formsin((n+1)θ)/sin(θ)(and thesinhversion forx > 1) instead of callinghyp2f1directly. Withhyp2f1the results drift badly for larger|n|oncexis negative:SciPy has the same problem for non-integer degrees, so the test fixtures are generated with
mpmath.chebyurather than SciPy.Related Issues
This pull request has the following related issues:
x#124Questions
Is the closed form OK for non-integer degrees, or would you rather keep
hyp2f1to match SciPy? I can also add the C implementation in a follow-up PR.Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
I used Claude Code to write the package, tests and docs, following the layout of
hyp2f1and the review comments on #5774. I checked accuracy against mpmath and SciPy, and ran the tests, examples and benchmark locally.@stdlib-js/reviewers