JuliaApproximation / JuliaApproximation/FastTransforms.jl
Validated transforms
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 281
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
This would be fun. As seen below, it almost "just works," but would require a careful investigation into https://github.com/MikaelSlevinsky/FastTransforms/blob/master/src/transforms_mpfr.c. The ccalls pass on Base.MPFR.RoundingMode[] to the C library, so it's just a matter of making sure every arithmetic operation is appropriate for RoundUp/Down. For example, I think the token error is due to using mpfr_neg.
julia> using FastTransforms
julia> setrounding(BigFloat, RoundDown)
MPFRRoundDown::MPFRRoundingMode = 3
julia> pd = plan_leg2cheb(BigFloat, 10)
FastTransforms Legendre--Chebyshev plan for 10-element array of BigFloat
julia> Pd = lmul!(pd, Matrix{BigFloat}(I, 10, 10));
julia> setrounding(BigFloat, RoundUp)
MPFRRoundUp::MPFRRoundingMode = 2
julia> pu = plan_leg2cheb(BigFloat, 10)
FastTransforms Legendre--Chebyshev plan for 10-element array of BigFloat
julia> Pu = lmul!(pu, Matrix{BigFloat}(I, 10, 10));
julia> Pu-Pd # rigorously off by only one entry
10×10 Array{BigFloat,2}:
0.0 0.0 -2.15904e-78 0.0 2.15904e-78 0.0 2.15904e-78 0.0 3.23856e-78 0.0
0.0 0.0 0.0 8.63617e-78 0.0 8.63617e-78 0.0 1.07952e-77 0.0 8.63617e-78
0.0 0.0 0.0 0.0 8.63617e-78 0.0 8.63617e-78 0.0 1.07952e-77 0.0
0.0 0.0 0.0 1.72723e-77 0.0 1.29543e-77 0.0 1.29543e-77 0.0 1.29543e-77
0.0 0.0 0.0 0.0 1.72723e-77 0.0 1.72723e-77 0.0 1.51133e-77 0.0
0.0 0.0 0.0 0.0 0.0 2.59085e-77 0.0 1.94314e-77 0.0 1.51133e-77
0.0 0.0 0.0 0.0 0.0 0.0 3.45447e-77 0.0 1.94314e-77 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.88628e-77 0.0 2.15904e-77
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.88628e-77 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4.31808e-77
julia>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the BigFloat RoundDown/RoundUp example in the issue, then inspect src/transforms_mpfr.c and its ccall arithmetic. Audit the operations involved, including the reported mpfr_neg case, and verify that validated transforms behave correctly under both rounding modes without the token error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100