AngouriMath
PolynomialFactoring
Description
Summary
Factors a polynomial in one variable into linear factors with whole roots:
x^2 + 2x + 1 becomes (x + 1)^2 , and
x^3 - 6x^2 + 11x - 6 becomes (x - 1)(x - 2)(x - 3) .
Remarks
Deliberately narrow, on two counts.
Rational roots only. Factoring through every root would answer
(x - i)(x + i) for x^2 + 1 and (x - sqrt(2))(x + sqrt(2)) for
x^2 - 2 , which is not what anyone means by factoring those.
And only when the polynomial splits completely into whole roots. A partly factored
answer is not obviously better than the sum it came from, and fractional roots turn
up mostly in the output of calculus, where the expanded form is the conventional
one: the antiderivative ofx^2 + x reads better as x^3/3 + x^2/2 than
asx^2 * (x + 3/2) / 3 .
What comes out of here is a candidate, not a decision. The simplifier keeps it
alongside the other forms it has found and picks between them by its complexity
metric, which is whyx^2 - 1 stays as it is while (x + 1)^2 wins.
answer is not obviously better than the sum it came from, and fractional roots turn
up mostly in the output of calculus, where the expanded form is the conventional
one: the antiderivative of
as
alongside the other forms it has found and picks between them by its complexity
metric, which is why
Members
DivideByLinear(PeterO.Numbers.ERational[],PeterO.Numbers.ERational)
MethodEvaluate(PeterO.Numbers.ERational[],PeterO.Numbers.ERational)
MethodLinearFactor(PeterO.Numbers.ERational,AngouriMath.Entity.Variable)
MethodMaxDegree
FieldMultiplyByLinear(PeterO.Numbers.ERational[],PeterO.Numbers.ERational)
MethodTrySplitOffRationalRoots(AngouriMath.Entity,AngouriMath.Entity.Variable,AngouriMath.Entity@)
Method
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1953 pages online