Repository navigation
Compiled max and min have no value off the real line - #2311
Merged
Rafael-SOWNet merged 1 commit intoNov 1, 2026
Merged
Conversation
#2304 made max and min defined only where both arguments are real, so max(i, i) and max(x, x) at a complex x have no value. The compiled forms, FastExpression and LINQ over Complex, share RealOnly.Ordered, which returned an argument equal to the other before it asked whether either was real, as the interpreter once did. Compiled max(x, x) at 1/2 + 6/5 i was 1/2 + 6/5 i, and max(x, x) * 2 was 1 + 12/5 i, where evaluation says NaN. The check for a non-real argument now comes first. Found by work/compilesweep: 27 of its findings are max or min at a complex point. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2311 +/- ##
==========================================
- Coverage 86.77% 86.76% -0.01%
==========================================
Files 311 311
Lines 68199 68199
Branches 19821 19821
==========================================
- Hits 59178 59175 -3
- Misses 4880 4882 +2
- Partials 4141 4142 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
deleted the
compiled-max-and-min-have-no-value-off-the-real-line
branch
November 1, 2026 15:13
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.
#2304 made
maxandmindefined only where both arguments are real, somax(i, i), andmax(x, x)at a complexx, have no value. The compiled forms didn't follow. FastExpression and the LINQ compiler overComplexshareRealOnly.Ordered, which returned an argument equal to the other before it asked whether either was real. The interpreter used to do the same. The check for a non-real argument now comes first.x = 0.5 + 1.2imax(x, x)NaN<0.5; 1.2><NaN; NaN>min(x, x)NaN<0.5; 1.2><NaN; NaN>max(x, x) * 2NaN<1; 2.4><NaN; NaN>work/compilesweep. On its default 3000 expressions it lists 112 findings on master and 93 here. The 19 that go are allmaxorminat a complex point, and none is added. Themax/minfindings that remain have other causes: a 1e-16 imaginary part left by rounding,ImofNaN,0 mod xat a complexx.BREAKING-CHANGES.mdentry for DomainCondition disagrees with the value for five nodes #2256 gains the compiled row.Follows #2304, for #2256.
🤖 Generated with Claude Code