\\ (C) 2007-2008 Marco Bodrato \\ This code is released under GNU-GPL 3.0 licence. \\ 4-way asymmetric squaring, \\ recurse on both products and squares. U = U3*x^3 + U2*x^2 + U1*x + U0 \\ P(x)[2]: P0=0; P1=P'(0); P2=; P3=; P4=1; P5=P'(1/0); P6=1/0 \\ Evaluation[1]: 6 add|sub, 1 shift; 4 mul, 3 sqr (n) W2 = U0 - U2 ; W6= U3 - U1 W1 = W2 - W6 ; W5= W2 + W6 W0 =(U2 + U3)<<1 + W1 W4 =(W1)*(W5) ; W3 =(W2)*(W6) W5 = U3 * U2 ; W1 = U0 * U1 W2 =(W0)^2 W6 = U3 ^2 ; W0 = U0 ^2 \\ Interpolation[1,2]: 8 add|sub, 4 shift (2n) W2 =(W2 - W4)>>1 + W3 W3 =(W3 + W1 + W5)<<1 W2 = W2 - W3 W4 = W4 + W2 - W0 W2 = W2 - W6 W1<<=1 ; W5<<=1 \\ Recomposition: check U^2 == W6*x^6 + W5*x^5 + W4*x^4 + W3*x^3 + W2*x^2 + W1*x + W0 \\ References: http://bodrato.it/papers/#WAIFI2007 \\ [1] Marco BODRATO,"Towards Optimal Toom-Cook Multiplication \\ for Univariate and Multivariate Polynomials in Characteristic \\ 2 and 0"; "WAIFI'07 proceedings" (C.Carlet and B.Sunar, eds.) \\ LNCS#4547, Springer, Madrid, Spain, June 2007, pp. 116-133. \\ [2] J. CHUNG and M.A. Hasan,"Asymmetric squaring formulae"; \\ Technical Report CACR 2006-24, University of Waterloo, \\ Ontario, Canada, 2006