AngouriMath

Navigation

← Back to list of members

ConditionallyGreater​(AngouriMath.​Entity,​AngouriMath.​Entity)

 Method (no overloads)

Summary

left exceeds right, stated as a comparison of
their difference against zero — which is the form the inequality rules can decide.

Remarks

SimplifyChildren(AngouriMath.Entity) alone is not enough to reach that form. It simplifies
the operands and leaves the sum standing, so a - a / 3 comes back as
a + -a / 3 — two terms in one variable, which no rule about a sign can read.
RationalCanonicalization collects them into
2/3 * a, and a rational multiple of something is positive exactly when that
something is, so a in (a / 3; 3 * a) is a > 0.
It was a in (a / 2; 2 * a) alone that answered before, and by coincidence
rather than by this route: nothing collected the terms, and the answer came out of
Simplify(System.Int32)'s candidate search happening to reach it for that
one denominator. Three, four, five and six were all left as written.
#1056
Then the comparison itself is normalised, and that is what makes the answer reachable
rather than merely correct. Simplify prunes a candidate by
SimplifiedRate at each step, and 2/3 * a > 0 and 2 * a > 0 rates 26
where the membership it came from rates 25 — one point worse, so it was discarded
before anything could reduce it to a > 0, which rates 8. The n = 2 case
answered only because 1/2 * a > 0 and a > 0 happens to rate 24. Dividing
out the positive factor here, with the rule set that already knows how, means the
candidate is born at its best rate instead of having to survive on the way there.
Two named transformations rather than a call back into Simplify(System.Int32),
deliberately: this runs inside a rewrite rule that Simplify itself applies, and
the full simplifier here would be a cycle through the interval rule rather than a
deeper answer.

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online