Repository navigation
Newton's solver, the spurious-root filter and Gruntz without catch-alls - #1568
Merged
Merged
Conversation
Six catches wrapped code that declines by returning NaN, null or false already: four in Newton's solver (one catching an OverflowException that System.Numerics.Complex arithmetic does not throw), the spurious-root filter's residual check, and the Gruntz limit's entry. Each site was instrumented and logged every exception it caught, over the whole unit suite and a 598-problem sample of Rubi's families 0 to 8: none caught anything. They go, so that a defect below them reaches the caller instead of reading as a decline, and so does the OperationCanceledException that four of them took for one. A residual Newton cannot rank, one that is not a finite number, still ranks last, now by a test rather than a catch. The unit tests pass (net10.0, 13354), every target builds, and the allocation gate passes. Closes #1547. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #1547 (part of #1540's review of exceptions used for control flow).
Six
catch (Exception)clauses wrapped code that already declines by returning NaN, null or false:NewtonSolver, four:OverflowExceptionthatSystem.Numerics.Complexarithmetic does not throw (it gives infinities and NaN, which the loop already handles), under a// TODO: remove try catch in for;RealValueAtaround the compiled function's call;OnePerRoot's residual, which now ranks a residual that is not a finite number last by a test rather than a catch;Satisfies, which already answerstruefor anything it cannot check.IsSpuriousinSolveStatement.cs), which already keeps a root it cannot evaluate.AngouriBugExceptionandOperationCanceledException.How it was decided. Each of the six sites, and the ten in #1546, was instrumented to log every exception it caught, then run over the whole unit suite and a 598-problem sample of Rubi's families 0 to 8. None of these six caught anything. So they go: a defect below them now reaches the caller instead of reading as a decline. The same goes for an
OperationCanceledExceptionfrom a cancellation checkpoint, which the four that caughtExceptiontook for a decline.No answer changes, so no
BREAKING-CHANGES.mdentry.Measured against master 5f9e3db: the unit tests pass (net10.0, 13354 passed), every target builds, and the allocation gate passes on this tree: allocation is what the baseline says on all 19 gated benchmarks.
🤖 Generated with Claude Code