Handbook
Glossary
p* ( p q -- r )
Polynomials
Prev:
p- ( p q -- r )
Next:
p-sq ( p -- p^2 )
Vocabulary
math
.
polynomials
Inputs
p
a polynomial
q
a polynomial
Outputs
r
a polynomial
Word description
Multiplies two polynomials.
Examples
USING: math.polynomials prettyprint ; { 1 2 3 0 0 0 } { 1 2 0 0 } p* .
{ 1 4 7 6 0 0 0 0 0 }
Definition
USING:
kernel
math.polynomials.private
math.vectors
sequences
;
IN:
math.polynomials
:
p*
( p q -- r )
2unempty
pextend-conv
[
drop
length
[
<iota>
]
keep
]
[
nip
<reversed>
]
[
drop
]
2tri
[
[
<slice>
]
2curry
]
dip
[
vdot
]
curry
compose
map
reverse!
;