AngouriMath

Navigation

← Back to list of members

PolynomialFactorization

 Property

Summary

Factors a polynomial by the polynomial layer — square-free decomposition, Zassenhaus
over Q, Kronecker's substitution and Hensel lifting — rather than by a rule.

Remarks

A rule set factors what someone wrote a rule for. x ^ 2 - 1 has one and
x ^ 3 - 1 does not, which is why Factorize(System.Int32) — the
operation whose entire job is factorisation — was worse at it than the machinery that
exists for it. #1018
This is not the cost-model question. The reason the polynomial layer is not
wired into Simplify is that SimplifiedRate prefers the expanded
form — x ^ 6 - 1 rates 12 expanded against 58 factored — so a factored candidate
could never win a search. There is no search here: Factorize is asked for the
factored form and returns it.
Which variable. The layer factors with respect to one, and an expression has
several. Each of its variables is tried in turn and the first that yields a genuine
product wins, which is deterministic because Vars is. Trying them
all rather than guessing a main one is what makes x ^ 4 - y ^ 4 come out whole
however the caller wrote it.
What it declines. Anything that is not a polynomial, anything the layer refuses,
and anything whose answer is not a product — a refusal leaves the expression exactly as
the rules left it, so nothing that factored before can stop factoring.

Remarks

Held in a nested class rather than in a static field of this one. Static field
initialisers run in declaration order, and Factorization — declared
above — is eager, so a field here would still be null when its
pipeline is built. That surfaces as ArgumentNullException(nameof(next)) from a
combinator rather than as anything naming the real cause, and this file has had that
failure before. A nested type is initialised on first touch, whatever order this
one's members are written in.

























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