UnivariatePolynomialMultiplicationPackage(R, U)¶
poly.spad line 1311 [edit on github]
R: Ring
This package implements Karatsuba's trick for multiplying (large) univariate polynomials. It could be improved with a version doing the work on place and also with a special case for squares. We’ve done this in Basicmath, but we believe that this out of the scope of FriCAS.
- karatsuba: (U, U, NonNegativeInteger, NonNegativeInteger) -> U
karatsuba(a, b, l, k)returnsa*bby applying Karatsuba'strick provided that bothaandbhave at leastlterms andk > 0holds and by callingnoKaratsubaotherwise. The other multiplications are performed by recursive calls with the same third argument andk-1as fourth argument.
- karatsubaOnce: (U, U) -> U
karatsuba(a, b)returnsa*bby applying Karatsuba'strick once. The other multiplications are performed by calling*fromU.
- noKaratsuba: (U, U) -> U
noKaratsuba(a, b)returnsa*bwithout using Karatsuba'strick at all.