Toom-Cook algorithm

Toom-Cook, also called Toom-3, is a Technique of multiplication used to multiply two great numbers. These great numbers are cut out moreover small numbers on which one will carry out calculations.

To multiply two numbers amounts multiplying two Polynôme S

With (X)

\begin{bmatrix} x^2 & x^1 & x^0 \end{bmatrix}
  • \begin{bmatrix}
a_2 & a_1 & a_0 \end{bmatrix}^T and
B (X)

\begin{bmatrix} x^2 & x^1 & x^0 \end{bmatrix}
  • \begin{bmatrix}
b_2 & b_1 & b_0 \end{bmatrix}^T what gives a third polynomial
P (X)

With (X) *B (X)

\begin{bmatrix} x^4 & x^3 & x^2 & x^1 & x^0 \end{bmatrix}
  • \begin{bmatrix}
p_4 & p_3 & p_2 & p_1 & p_0 \end{bmatrix}^T By evaluating it in five points
\begin{bmatrix} P (\ infty) \ \ P (2) \ \ P (- 1) \ \ P (1) \ \ P (0) \end{bmatrix}

\begin{bmatrix} 1 & 0 & 0 & 0 & 0 \ \ 16 & 8 & 4 & 2 & 1 \ \ 1 & -1 & 1 & -1 & 1 \ \ 1 & 1 & 1 & 1 & 1 \ \ 0 & 0 & 0 & 0 & 1 \end{bmatrix}
  • \begin{bmatrix}
p_4 \ \ p_3 \ \ p_2 \ \ p_1 \ \ p_0 \end{bmatrix} its coefficients can be given
\begin{bmatrix} p_4 \ \ p_3 \ \ p_2 \ \ p_1 \ \ p_0 \end{bmatrix}

\begin{bmatrix} 1 & 0 & 0 & 0 & 0 \ \ 16 & 8 & 4 & 2 & 1 \ \ 1 & -1 & 1 & -1 & 1 \ \ 1 & 1 & 1 & 1 & 1 \ \ 0 & 0 & 0 & 0 & 1 \ end {bmatrix} ^ {- 1}
  • \begin{bmatrix}
P (\ infty) \ \ P (2) \ \ P (- 1) \ \ P (1) \ \ P (0) \end{bmatrix} This calculation requires five multiplications three times simpler and some additions
\begin{bmatrix} p_4 \ \ p_3 \ \ p_2 \ \ p_1 \ \ p_0 \end{bmatrix}

\begin{bmatrix} 1 & 0 & 0 & 0 & 0 \ \ 16 & 8 & 4 & 2 & 1 \ \ 1 & -1 & 1 & -1 & 1 \ \ 1 & 1 & 1 & 1 & 1 \ \ 0 & 0 & 0 & 0 & 1 \ end {bmatrix} ^ {- 1}
  • \begin{bmatrix}
With (\ infty) *B (\ infty) \ \ With (2) *B (2) \ \ With (- 1) *B (- 1) \ \ With (1) *B (1) \ \ With (0) *B (0) \end{bmatrix}

\begin{bmatrix} 1 & 0 & 0 & 0 & 0 \ \ 16 & 8 & 4 & 2 & 1 \ \ 1 & -1 & 1 & -1 & 1 \ \ 1 & 1 & 1 & 1 & 1 \ \ 0 & 0 & 0 & 0 & 1 \ end {bmatrix} ^ {- 1}
  • \begin{bmatrix}
a_2*b_2 \ \ (4a_2+2a_1+a_0) * (4b_2+2b_1+b_0) \ \ (a_2-a_1+a_0) * (b_2-b_1+b_0) \ \ (a_2+a_1+a_0) * (b_2+b_1+b_0) \ \ a_0*b_0 \end{bmatrix} The Complexité is thus
O (n^ {\ log _3 (5)}) \ simeq O (n^ {1.465})

See too

References

  • ТоомАндрейЛеонович, Осложностисхемыизфункциональныхэлементов, реализующейумножениецелыхчисел , ДокладыАкадемииНаукСССР, T.150, N°3, pagg.496-498 * D. Knuth. The Art off Computer Programming , Volume 2. Third edition, Addison-Wesley, 1997.
  • R. Crandall & C. Pomerance. Numbers Premium - has Computational Perspective . Second edition, Springer, 2005.

Random links:Scarab3ee rhinoceros | Jacques-Rousseau price | Bruce All Saints' day | Arbogast of Strasbourg | Archipelago Reina Adelaida | John_Schoenherr