Fix low precision for BigFloats in ExpMethodGeneric (Issue #44)#205
Merged
ChrisRackauckas merged 2 commits intoSciML:masterfrom Jan 12, 2026
Merged
Conversation
The `ExpMethodGeneric` exponential implementation was using a fixed (13,13) Padé approximant regardless of the floating-point precision, which is only appropriate for Float64 (~53 bits). For BigFloat with default 256-bit precision, this resulted in errors of ~10^42 eps instead of machine precision. Changes: - Add `pade_order_for_type(T)` to compute the minimum Padé order k needed for machine-precision accuracy for a given floating-point type - Automatically detect high-precision types (BigFloat, etc.) and use the appropriate Padé order when `ExpMethodGeneric()` is called - Add `ExpMethodGeneric(k)` constructor to manually specify order - Add `ExpMethodGeneric(T)` constructor to select order based on type - Add tests verifying machine-precision accuracy for BigFloat with various precision settings (128, 256, 512 bits) The fix computes k based on the error bound for (k,k) Padé approximants: (x/2)^(2k+1) / (2k+1)! < 2^(-precision_bits) Results: - Float64: k=13 (unchanged, ~10 eps error) - BigFloat 128-bit: k=15 - BigFloat 256-bit: k=25 - BigFloat 512-bit: k=43 - BigFloat 1024-bit: k=76 Fixes SciML#44 cc @ChrisRackauckas 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create test/jet directory with its own Project.toml for JET dependencies - Move JET tests from qa.jl to test/jet/jet.jl - Add activate_jet_env() function to runtests.jl following GPU pattern - Remove JET from main Project.toml extras, compat, and test targets - JET tests now run with GROUP=JET environment variable This follows the same pattern as GPU tests, allowing JET to have its own dependency resolution separate from the main test suite. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
JET Test SeparationAdded commit to split JET tests into a separate test group with its own environment, following the same pattern as GPU tests. Changes:
How to run JET tests:GROUP=JET julia --project -e 'using Pkg; Pkg.test()'This follows the pattern from OrdinaryDiffEq.jl and DelayDiffEq.jl for separating heavy analysis tools like JET into their own test environments. |
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.
Summary
ExpMethodGeneric(Fixes exp_generic has low precision for BigFloats #44)pade_order_for_type(T)to compute the minimum Padé order needed for machine-precision accuracyProblem
The
ExpMethodGenericexponential implementation was using a fixed (13,13) Padé approximant regardless of the floating-point precision. This is only appropriate for Float64 (~53 bits). For BigFloat with default 256-bit precision, this resulted in errors of ~10^42 eps instead of machine precision.Solution
The fix computes k based on the error bound for (k,k) Padé approximants:
(x/2)^(2k+1) / (2k+1)! < 2^(-precision_bits)Results:
Test plan
cc @ChrisRackauckas
🤖 Generated with Claude Code