Skip to content

max and min are defined where their arguments are real - #2261

Open
Rafael-SOWNet wants to merge 1 commit into
masterfrom
max-and-min-are-defined-on-the-reals
Open

Rafael-SOWNet wants to merge 1 commit into
masterfrom
max-and-min-are-defined-on-the-reals

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

The complex numbers are not ordered, and max and min are read over the reals, so max(i, i) is NaN and max(i, 2) is left as written. Their condition was True, and max(x, x) simplified to x, which has a value at x = i. The condition is now that both arguments are real. The node's own fold of max(a, a) to a did not consult the condition. It now gives a provided a in RR, simplified in place, so max(i, i) stays NaN, max(3, 3) is 3, and a symbol keeps the condition.

2.6.0 and master this branch
"max(x, x)".ToEntity().Simplify() x x provided x in RR
"max(x, 2)".ToEntity().DomainCondition True x in RR
"max(i, i)".ToEntity().Evaled NaN NaN

MaxMinOffTheRealLineTest: four cases fail on master and four pass on both. RoundMinMaxGcdTest pinned min(x, x) as x, and now has x provided x in RR. Suite 18188 passed. The F# wrapper suite, the Mcp, Terminal and InteractiveWrapper suites and the AOT smoke test pass. BoundCheck, RootCheck, CasBench, PropCheck, SimpSweep, RuleCheck, CanonCheck and Confluence are unchanged. Found by work/domaincheck.

Part of #2256.

🤖 Generated with Claude Code

The complex numbers are not ordered, and max and min are read over the
reals, so max(i, i) is NaN and max(i, 2) is left as written. Their
condition was True, and max(x, x) simplified to x, which has a value at
x = i. The condition is now that both arguments are real.

The node's own fold of max(a, a) and min(a, a) to a did not consult the
condition, and is now a provided a in RR, simplified in place: for a
number that decides it, so max(i, i) stays NaN and max(3, 3) is 3, and
for a symbol it is the condition.

MaxMinOffTheRealLineTest takes the condition and the value at four
points, max(i, i) and min(1 + i, 1 + i), and max(x, x) and min(x, x)
simplified, at i and at 3. Four of the cases fail on master. A value
where the condition fails is NaN, or the node left as written.
RoundMinMaxGcdTest pinned min(x, x) as x, and now has x provided x in
RR, with min(3, 3) beside it.

Found by work/domaincheck.

Part of #2256.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Rafael-SOWNet Rafael-SOWNet added this to the 2.7.0 milestone Oct 30, 2026
@Rafael-SOWNet Rafael-SOWNet moved this from Todo to In review in AngouriMath Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.71%. Comparing base (0e791f5) to head (36d95e6).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2261   +/-   ##
=======================================
  Coverage   86.71%   86.71%           
=======================================
  Files         310      310           
  Lines       67791    67816   +25     
  Branches    19666    19676   +10     
=======================================
+ Hits        58785    58808   +23     
  Misses       4893     4893           
- Partials     4113     4115    +2     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
csharp 87.26% <100.00%> (+<0.01%) ⬆️
fsharp 32.97% <ø> (ø)
interactive 40.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nuous/Evaluation.Continuous.Arithmetics.Classes.cs 87.23% <100.00%> (+0.24%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

1 participant