AngouriMath

Navigation

← Back to list of members

AscendingEndpoints​(AngouriMath.​Entity,​AngouriMath.​Entity)

 Method (no overloads)

Summary

The two roots as (smaller, larger).

Remarks

SortRealsAndNonReals(System.Collections.Generic.IEnumerable{AngouriMath.Entity}) orders the roots it can compare
and leaves the rest in the order the quadratic formula produced them, which is
(-b - sqrt(D))/(2a) before (-b + sqrt(D))/(2a) -- ascending only
while a is positive. Solving expr <= 0 negates the expression and
so arrives here with a negative leading coefficient, which is how
(x - a)(x + a) <= 0 came to be answered with an interval running from
|a| to -|a|: empty, with the whole solution set lost.
Written with abs rather than as a case split on the sign of the symbol,
because the ordering has a closed form -- min(p, q) is
(p + q - |p - q|)/2 and max(p, q) is (p + q + |p - q|)/2. So
the answer is the single interval [-|a|; |a|], which is right for either
sign of a and for a = 0, rather than three branches each holding on
part of the line. It also keeps the result a Set: a piecewise is an
Entity and not one, so returning it here is not open in any case.
Where both roots are real numbers the sort above has already ordered them, and
they are handed back untouched so that nothing a concrete coefficient produces
changes shape.
#757

























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