Polynomials


A polynomial is a vector with the highest powers on the right:
{ 1 1 0 1 } -> 1 + x + x^3 { } -> 0

Numerous words are defined to help with polynomial arithmetic:
p= ( p q -- ? )

p+ ( p q -- r )

p- ( p q -- r )

p* ( p q -- r )

p-sq ( p -- p^2 )

p^ ( p n -- p^n )

powers ( n x -- seq )

n*p ( n v -- w )

p/mod ( p q -- z w )

pgcd ( p q -- a d )

polyval ( x p -- p[x] )

pdiff ( p -- p' )

pextend-conv ( p q -- p' q' )

ptrim ( p -- q )

2ptrim ( p q -- p' q' )