Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement boundary asymptotics #131

Merged
merged 8 commits into from
Dec 9, 2023
Merged

Conversation

pbeckman
Copy link
Contributor

@pbeckman pbeckman commented Dec 4, 2023

I've translated the MATLAB routine feval_asy2 in chebfun/jacpts.m which implements the boundary asymptotics from Hale and Townsend 2012. These asymptotics are necessary to get high accuracy Gauss-Jacobi weights, particularly for large $N$ and $\alpha, \beta < -0.5$.

I've included tests which verify that issues #58 and #130 are both resolved by these changes.

This implementation relies on storing $10 \times 10$ Chebyshev differentiation and integration matrices to numerically evaluate the higher order coefficients in the relevant asymptotics. Personally I think this is a mild price to pay, and avoids reliance on other packages. However, @dlfivefifty suggested that creating a core ChebyshevTransforms.jl package to be used also by other interfaces may be a more elegant solution.

@dlfivefifty
Copy link
Member

I think this is a good solution for now.

Copy link
Collaborator

@hyrodium hyrodium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not looked into math details yet. I added some minor comments.

src/gaussjacobi.jl Outdated Show resolved Hide resolved
src/gaussjacobi.jl Outdated Show resolved Hide resolved
src/gaussjacobi.jl Show resolved Hide resolved
src/gaussjacobi.jl Show resolved Hide resolved
src/gaussjacobi.jl Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c3a7394) 96.62% compared to head (5a86bc1) 96.89%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   96.62%   96.89%   +0.26%     
==========================================
  Files           9        9              
  Lines        1244     1384     +140     
==========================================
+ Hits         1202     1341     +139     
- Misses         42       43       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dlfivefifty
Copy link
Member

This is certainly MATLAB-style code, but so is most of this package.... I think trying to de-matlab the code at this point is a fools-errand.

If the tests pass we should just merge and someone can improve the style/using SMatrix/etc. in a separate PR.

@pbeckman
Copy link
Contributor Author

pbeckman commented Dec 5, 2023

Sounds good. I made some of the small changes that @hyrodium suggested, and added a test to cover a few previously untested lines of the bary interpolation function. So hopefully all the Codecov tests will pass now.

test/test_gaussjacobi.jl Outdated Show resolved Hide resolved
test/test_gaussjacobi.jl Outdated Show resolved Hide resolved
test/test_gaussjacobi.jl Outdated Show resolved Hide resolved
@hyrodium
Copy link
Collaborator

hyrodium commented Dec 6, 2023

Could you please add more tests for the coverage?
https://github.com/JuliaApproximation/FastGaussQuadrature.jl/pull/131/checks?check_run_id=19351711888

@pbeckman
Copy link
Contributor Author

pbeckman commented Dec 7, 2023

I've satisfied all the code coverage checks. Let me know if there's anything else I can do to get things finalized.

@dlfivefifty
Copy link
Member

I'll merge if no one objects in the next day

@MikaelSlevinsky
Copy link
Member

This is a great addition! It should be merged ASAP.

Copy link
Collaborator

@hyrodium hyrodium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Could you bump the version to v1.0.1?

@hyrodium hyrodium merged commit bd82113 into JuliaApproximation:master Dec 9, 2023
12 checks passed
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.

4 participants