AngouriMath
MayBeAPolynomialWithRationalCoefficients(AngouriMath.Entity,AngouriMath.Entity.Variable)
Method (no overloads)
Summary
Whether expr has the shape of a polynomial in x whose coefficients could all be rational: x occurs only under
sums, products, quotients by something free of it, and whole non-negative powers,
and no subtree free ofx carries a symbol or a constant. A
necessary condition, read off the tree without building anything; what passes it
is still expanded and checked.
sums, products, quotients by something free of it, and whole non-negative powers,
and no subtree free of
necessary condition, read off the tree without building anything; what passes it
is still expanded and checked.
Remarks
A symbol in a coefficient is refused outright rather than expanded and evaluated,
because a coefficient with a symbol in it is not rational, and the one way it could
still be -- the symbol cancelling against itself across terms -- is what
InnerSimplified has already collected before anything here is
asked. A constant is refused for the same reason: pi is not rational either. An
irrational literal such assqrt(2) is not refused here, since it is a power of
a rational and reads as one; the expansion still decides it.
because a coefficient with a symbol in it is not rational, and the one way it could
still be -- the symbol cancelling against itself across terms -- is what
InnerSimplified has already collected before anything here is
asked. A constant is refused for the same reason: pi is not rational either. An
irrational literal such as
a rational and reads as one; the expansion still decides it.
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online