Integer roots |
The function
The input polynomial is a
The roots are returned as a
|
The lacunaryx package comes with a new type for polynomials
called
Mmx] |
use "lacunaryx"; type_mode? := true; |
Mmx] |
x : LPolynomial Integer == lpolynomial(1:> Integer, 1) |
:
Mmx] |
p : LPolynomial Integer == x^2*(x+1)^2*(x-2)*(x+3)^3*(2*x+3)*(x^2+x+1) |
:
Mmx] |
q : LPolynomial Integer == -x^876546523 + x^876546522 + 2*x^876546520 - 2*x^876546519 + 2*x^156476833 - 12*x^156476832 + 10*x^156476831 + 8*x^1346 - 8*x^1345 - x + 1 |
:
Mmx] |
roots (p*q) |
:
The function
The function
Mmx] |
X : Coordinate == coordinate ('x) |
:
Mmx] |
x : LMVPolynomial Integer == lmvpolynomial(1:>Integer, X) |
:
Mmx] |
p : LMVPolynomial Integer == x^2*(x+1)^2*(x-2)*(x+3)^3*(2*x+3)*(x^2+x+1) |
:
Mmx] |
q : LMVPolynomial Integer == -x^876546523 + x^876546522 + 2*x^876546520 - 2*x^876546519 + 2*x^156476833 - 12*x^156476832 + 10*x^156476831 + 8*x^1346 - 8*x^1345 - x + 1 |
:
Mmx] |
roots(p*q) |
: