Karatsuba and Fast Multiplication

Grade-school multiplication of two nn-digit numbers takes Θ(n2)\Theta(n^2) single-digit operations. Line up every digit of one number against every digit of the other. This is exactly as taught in elementary school. For small numbers this is fine. But modern systems multiply numbers with thousands or millions of digits. Examples include cryptographic keys, arbitrary-precision arithmetic libraries, computer algebra systems, and record-breaking computations of π\pi. At that scale, quadratic time is a wall. The question that opens this article is simple to state. Yet it shockingly resisted an easy answer for millennia: can we multiply two nn-digit numbers in fewer than n2n^2 digit-multiplications? In 1960, Andrey Kolmogorov conjectured — in a seminar at Moscow State University — that Ω(n2)\Omega(n^2) multiplications were unavoidable. He believed the schoolbook method to be optimal. Within a week, a 23-year-old student named Anatoly Karatsuba found a method beating it. He used a clever algebraic trick to multiply two nn-digit numbers with only three half-size multiplications instead of four. Kolmogorov was reportedly so excited he arranged for Karatsuba's result to be published immediately. The seminar itself was discontinued, since its central open problem had just been resolved. Karatsuba's algorithm is a foundational example of the Divide and Conquer Paradigm: split a problem into subproblems, solve them recursively, and combine the results. What makes it pedagogically special is that the split is the easy part. Any schoolchild can split a number into a high half and a low half. But the combine step usually forces four multiplications (a classic 2×22\times 2 block-matrix-like expansion). Karatsuba's insight is an algebraic identity that computes the same information from only three products. This one saved multiplication is precisely what breaks the quadratic barrier via the Master Theorem for Recurrences. This article derives the identity, and states and proves the algorithm precisely. It works the recurrence exactly, and traces a full numeric example by hand. It also situates Karatsuba's algorithm within the broader family of fast multiplication methods. These include Toom-Cook, Schönhage-Strassen, and the more recent Harvey–van der Hoeven near-linear algorithm. Throughout, it stays honest about where the crossover point actually lies in practice.

Key takeaways
  • Schoolbook multiplication of nn-digit numbers costs Θ(n2)\Theta(n^2); Karatsuba's algorithm reduces this to Θ(nlog⁡23)≈Θ(n1.585)\Theta(n^{\log_2 3}) \approx \Theta(n^{1.585}).
  • The key trick: compute (a1+a0)(b1+b0)(a_1+a_0)(b_1+b_0) once and reuse it, needing only 3 half-size multiplications instead of the naive 4.
  • The recurrence T(n)=3T(n/2)+O(n)T(n) = 3T(n/2) + O(n) solves via the Master Theorem, case 1, since log⁡23>1\log_2 3 > 1.
  • Correctness follows from a pure algebraic identity — no approximation, no probability, exact integer arithmetic throughout.
  • In practice, Karatsuba beats schoolbook multiplication only past a crossover point (often tens to hundreds of digits); below that, constant factors dominate.
  • Karatsuba is one member of a hierarchy — Toom-Cook generalizes it, and Schönhage-Strassen/Harvey–van der Hoeven push toward O(nlog⁡n)O(n \log n) using FFT-based convolution.
The core insight

Multiplying two numbers only needs three half-size multiplications, not four, because the cross terms a1b0+a0b1a_1b_0 + a_0b_1 can be recovered from a single extra product (a1+a0)(b1+b0)(a_1+a_0)(b_1+b_0).

The idea

Represent each nn-digit (or nn-bit) integer in a base BB (e.g., B=10B=10 or B=232B=2^{32}) by splitting it into a high half and a low half at position m=⌈n/2⌉m = \lceil n/2 \rceil:

x=x1Bm+x0,y=y1Bm+y0,x = x_1 B^m + x_0, \qquad y = y_1 B^m + y_0,

where x0,y0x_0, y_0 hold the low-order mm digits and x1,y1x_1, y_1 hold the remaining high-order digits. The product expands exactly as

xy=x1y1B2m+(x1y0+x0y1)Bm+x0y0.xy = x_1y_1 B^{2m} + (x_1y_0 + x_0y_1)B^m + x_0y_0.

This is precisely the identity used for multiplying two-digit numbers by hand, generalized recursively. Computed naively, it requires four multiplications of half-size numbers: x1y1x_1y_1, x1y0x_1y_0, x0y1x_0y_1, x0y0x_0y_0. Doing this recursively gives the recurrence T(n)=4T(n/2)+O(n)T(n) = 4T(n/2) + O(n), which solves to Θ(n2)\Theta(n^2) — no asymptotic improvement over schoolbook multiplication at all. Karatsuba's contribution is an algebraic reduction from four multiplications to three. Define the single auxiliary product

z1=(x1+x0)(y1+y0).z_1 = (x_1 + x_0)(y_1 + y_0).

Expanding, z1=x1y1+x1y0+x0y1+x0y0z_1 = x_1y_1 + x_1y_0 + x_0y_1 + x_0y_0. If we also compute z2=x1y1z_2 = x_1y_1 and z0=x0y0z_0 = x_0y_0 (two more multiplications, needed anyway for the outer and inner terms), then the middle cross term — which normally costs two multiplications — is recovered by pure subtraction:

x1y0+x0y1  =  z1−z2−z0.x_1y_0 + x_0y_1 \;=\; z_1 - z_2 - z_0.

So the entire product is reconstructed from exactly three half-size multiplications (z2z_2, z1z_1, z0z_0) plus a constant number of half-size additions/subtractions and shifts (multiplications by powers of BB, which are free — just index shifts):

xy=z2B2m+(z1−z2−z0)Bm+z0.xy = z_2 B^{2m} + (z_1 - z_2 - z_0) B^m + z_0.

This is the entirety of the trick: trade one multiplication for a handful of additions. Multiplication of large numbers is expensive; addition is cheap (linear time). The recursive structure is a textbook instance of Divide and Conquer Paradigm: split into subproblems of half the size, recurse, and combine in linear extra work — except here the number of subproblems (3, not 4) is the entire content of the algorithm.

How it works

The algorithm recurses on the size of the operands, bottoming out at some small size (often a single machine word) where multiplication is done directly by hardware. Negative numbers are handled by tracking sign separately and recursing on absolute values; here we describe the unsigned core. ``` function KARATSUBA(x, y, n): // x, y are n-digit numbers in base B (arrays of digits, most significant first // or an arbitrary-precision integer representation). n = max(len(x), len(y)). if n <= THRESHOLD: // base case: small enough for direct multiply return SCHOOLBOOK-MULTIPLY(x, y) m = ceil(n / 2) x1, x0 = split(x, m) // x = x1 B^m + x0 y1, y0 = split(y, m) // y = y1 B^m + y0 z2 = KARATSUBA(x1, y1, n - m) // high high z0 = KARATSUBA(x0, y0, m) // low low s_x = x1 + x0 // O(m) addition s_y = y1 + y0 // O(m) addition z1 = KARATSUBA(s_x, s_y, m + 1) // (x1+x0)(y1+y0); note possible carry digit middle = z1 - z2 - z0 // O(n) subtraction; equals x1y0 + x0y1 result = SHIFT(z2, 2*m) + SHIFT(middle, m) + z0 // O(n) additions/shifts return result ``` Three recursive calls, each on operands of size roughly n/2n/2 (the third, on sx,sys_x, s_y, may have one extra digit due to carry from the addition, but this only affects constants, not the asymptotic recurrence). Everything else — splitting, adding, subtracting, shifting — is linear-time array manipulation. The figure below shows the recursion as a ternary tree for one level of splitting, and how the three half-size products recombine into the full product.

Figure
Karatsuba recursion: one level of splitting into three half-size products
x·y = x1B^m + x0 times y1B^m + y0 x · y (size n) z2 = x1·y1 size n/2 z1 = (x1+x0)(y1+y0) size n/2 + O(1) z0 = x0·y0 size n/2 middle = z1 − z2 − z0 (= x1y0 + x0y1) result = z2·B^(2m) + middle·B^m + z0 Only 3 recursive multiplications per level — not 4 — so the recursion tree has 3^k leaves at depth k, each doing O(1) work at the base case. T(n) = 3T(n/2) + O(n) ⟹ T(n) = Θ(n^log₂3) ≈ Θ(n^1.585)

Complexity & correctness

Correctness. The proof is a direct algebraic identity, checked once and then inherited by induction on recursion depth. Write x=x1Bm+x0x = x_1B^m + x_0, y=y1Bm+y0y = y_1B^m + y_0. Then

xy=x1y1B2m+(x1y0+x0y1)Bm+x0y0.xy = x_1y_1B^{2m} + (x_1y_0+x_0y_1)B^m + x_0y_0.

Define z2=x1y1z_2 = x_1y_1, z0=x0y0z_0 = x_0y_0, z1=(x1+x0)(y1+y0)z_1 = (x_1+x_0)(y_1+y_0). Expanding z1z_1 by distributivity,

z1=x1y1+x1y0+x0y1+x0y0=z2+(x1y0+x0y1)+z0,z_1 = x_1y_1 + x_1y_0 + x_0y_1 + x_0y_0 = z_2 + (x_1y_0+x_0y_1) + z_0,

so x1y0+x0y1=z1−z2−z0x_1y_0 + x_0y_1 = z_1 - z_2 - z_0 exactly — no approximation, no rounding, this is an identity over the integers (or any commutative ring). Substituting back:

xy=z2B2m+(z1−z2−z0)Bm+z0,xy = z_2B^{2m} + (z_1-z_2-z_0)B^m + z_0,

which is exactly the value the algorithm returns. The base case (schoolbook multiply below the threshold) is trivially correct by definition. By strong induction on nn: if the three recursive calls on inputs of size <n< n return correct products (inductive hypothesis), the identity above shows the combine step produces the correct product for size nn. This closes the induction, so `KARATSUBA` is correct for all n≥1n \geq 1. One subtlety deserves care: x1+x0x_1 + x_0 and y1+y0y_1 + y_0 may have one more digit than x0,y0x_0, y_0 due to carry (e.g., splitting a 6-digit base-10 number into two 3-digit halves, the halves can each be up to 999999, so their sum can be up to 19981998, a 4-digit number). The recursive call on z1z_1 must be sized to accommodate this extra digit. This affects only the constant hidden in the recurrence's additive term, not the asymptotic recursion structure — a detail an implementation must get right, but which does not change the complexity analysis.

Complexity. Let T(n)T(n) be the time to multiply two nn-digit numbers. The algorithm makes 3 recursive calls on inputs of size ≈n/2\approx n/2, plus O(n)O(n) work for splitting, the two additions forming sx,sys_x, s_y, the final subtraction, and the shift-and-add combination (each of these is linear in the number of digits). Hence

T(n)=3 T(n/2)+O(n).T(n) = 3\,T(n/2) + O(n).

Apply the Master Theorem for Recurrences with a=3a = 3, b=2b = 2, and f(n)=O(n)f(n) = O(n). Compare f(n)f(n) to nlog⁡ba=nlog⁡23≈n1.585n^{\log_b a} = n^{\log_2 3} \approx n^{1.585}. Since f(n)=O(n)=O(nlog⁡23−ϵ)f(n) = O(n) = O(n^{\log_2 3 - \epsilon}) for ϵ=log⁡23−1≈0.585>0\epsilon = \log_2 3 - 1 \approx 0.585 > 0, we are in Case 1 of the Master Theorem, giving

T(n)=Θ ⁣(nlog⁡23)≈Θ(n1.585).T(n) = \Theta\!\left(n^{\log_2 3}\right) \approx \Theta(n^{1.585}).

A recursion-tree argument confirms this directly: at depth kk, there are 3k3^k subproblems, each of size n/2kn/2^k, doing O(n/2k)O(n/2^k) work each, for 3k⋅O(n/2k)=O(n)⋅(3/2)k3^k \cdot O(n/2^k) = O(n) \cdot (3/2)^k total work at that level. The tree has depth log⁡2n\log_2 n, and since (3/2)k(3/2)^k is strictly increasing in kk, the total work is dominated by the last level (a geometric series growing toward the leaves), giving total cost proportional to (3/2)log⁡2n⋅n=nlog⁡23(3/2)^{\log_2 n} \cdot n = n^{\log_2 3}. This is the hallmark of Master Theorem Case 1: work increases toward the leaves, so the leaves — not the root — dominate the total cost.

Space. The recursion depth is O(log⁡n)O(\log n), and each level allocates O(n)O(n) auxiliary space for sums, differences, and shifted results, giving O(nlog⁡n)O(n \log n) space for a naive recursive implementation (or O(n)O(n) with careful in-place buffer reuse, since siblings' memory can be freed after combining).

Honesty about tradeoffs. Karatsuba is asymptotically better than the Θ(n2)\Theta(n^2) schoolbook algorithm, but the constant factor and recursive overhead (allocation, function-call cost, extra additions) mean it only wins past a crossover point — commonly cited as tens to low hundreds of digits/limbs, and empirically tuned in real libraries such as GMP. Below that threshold, schoolbook multiplication (or even direct hardware multiply instructions) is faster in practice. Production big-integer libraries use a hybrid: schoolbook for small operands, Karatsuba (or Toom-Cook) for medium sizes, and FFT-based methods for very large ones.

Worked example

Multiply x=1234x = 1234 and y=5678y = 5678 (base B=10B=10, n=4n=4, split at m=2m=2). Split: x1=12, x0=34x_1 = 12,\ x_0 = 34; y1=56, y0=78\quad y_1 = 56,\ y_0 = 78.

StepComputationValue
z2z_2x1⋅y1=12×56x_1 \cdot y_1 = 12 \times 56672672
z0z_0x0⋅y0=34×78x_0 \cdot y_0 = 34 \times 7826522652
sxs_xx1+x0=12+34x_1 + x_0 = 12+344646
sys_yy1+y0=56+78y_1 + y_0 = 56+78134134
z1z_1sx⋅sy=46×134s_x \cdot s_y = 46 \times 13461646164
middlez1−z2−z0=6164−672−2652z_1 - z_2 - z_0 = 6164 - 672 - 265228402840
resultz2⋅104+middle⋅102+z0z_2 \cdot 10^{4} + \text{middle}\cdot 10^{2} + z_0672 0000+284000+2652672\,0000 + 284000 + 2652
=6720000+284000+2652= 6720000 + 284000 + 26527006652\mathbf{7006652}

Check directly: 1234×5678=7,006,6521234 \times 5678 = 7{,}006{,}652. ✓ Matches exactly. Notice 46×13446 \times 134 is itself computed by one more Karatsuba step in a real implementation (split 46=4∣646 = 4|6... though in practice recursion bottoms out once operands are small enough for direct multiplication — here we've simply used ordinary arithmetic for the sub-multiplications to keep the trace legible). The essential point of the trace is structural: only three multiplications (12×5612\times56, 34×7834\times78, 46×13446\times134) were needed to synthesize a 4-digit-by-4-digit product, where the schoolbook method would require four partial products (12×5612\times56, 12×7812\times78, 34×5634\times56, 34×7834\times78) — Karatsuba replaced the middle two multiplications with one multiplication plus three additions/subtractions. To see the savings compound, imagine recursing one level deeper on a 256256-digit number. Schoolbook multiplication does 2562=65536256^2 = 65536 single-digit products. Karatsuba's recursion tree at the base-case level (say, single digits) has 3log⁡2256=38=65613^{\log_2 256} = 3^8 = 6561 leaves — roughly a 10×10\times reduction in the total number of elementary multiplications, a gap that widens further as nn grows, since the ratio scales like (n2)/(n1.585)=n0.415(n^2)/(n^{1.585}) = n^{0.415}.

Common pitfalls & traps

PitfallWhy it happensFix
Forgetting the extra carry digit in sx,sys_x, s_yx1+x0x_1+x_0 can exceed mm digits, causing buffer overflow or truncationSize the z1z_1 recursive call for m+1m+1 digits, not mm
Not handling negative `middle`z1−z2−z0z_1 - z_2 - z_0 can be negative as an intermediate value even though the final result is positiveUse signed arithmetic internally, or bias/represent with sign-magnitude before combining
Ignoring the base case / thresholdRecursing all the way to single digits maximizes overhead from allocation and function callsSwitch to schoolbook multiplication below an empirically tuned threshold (often 20–100 digits)
Assuming Karatsuba is always fasterConstant factors and recursive overhead dominate for small nnBenchmark; use hybrid schoolbook/Karatsuba/Toom-Cook/FFT dispatch as real libraries do
Misapplying the Master TheoremTreating f(n)=O(n)f(n)=O(n) as if it were Θ(nlog⁡23)\Theta(n^{\log_2 3}), or comparing against the wrong watershed functionCarefully compute nlog⁡ban^{\log_b a} and check which Master Theorem case actually applies
Splitting asymmetrically without adjusting recursionUsing m≠⌈n/2⌉m \ne \lceil n/2\rceil arbitrarily can break the balanced-subproblem assumptionKeep the split as balanced as possible; unbalanced splits change the recurrence and the exponent

Pioneers & history

Anatoly Karatsuba's discovery is one of the cleanest stories in algorithms: a graduate seminar led by Andrey Kolmogorov at Moscow State University was devoted to lower bounds for arithmetic computation, and Kolmogorov conjectured that Ω(n2)\Omega(n^2) elementary operations were necessary to multiply two nn-digit numbers — believing the schoolbook algorithm to be optimal. Karatsuba, then a 23-year-old student attending the seminar, found the O(nlog⁡23)O(n^{\log_2 3}) algorithm described here within about a week of the conjecture being posed. Kolmogorov was so struck by the result that he reported it at the very next seminar meeting, and, since the seminar's central question had been answered, the seminar itself was discontinued. The paper was published in 1962, listing Kolmogorov as an author alongside Karatsuba (a common practice of the era), though the algorithm is universally attributed to Karatsuba individually today.

Origins · 1 minAnatoly Alexeyevich Karatsuba and how this was discovered
AA
Anatoly Alexeyevich Karatsuba
1937–2008 · Moscow State University; discovered the first subquadratic integer-multiplication algorithm as a student in 1960

Karatsuba went on to a distinguished career in analytic number theory, particularly on the Riemann zeta function and trigonometric sums, but is remembered in computer science almost entirely for this single, brilliantly simple divide-and-conquer trick discovered as a young student — a reminder that foundational algorithmic ideas do not always require elaborate machinery, only the right decomposition.

History
1960
Karatsuba discovers the O(nlog⁡23)O(n^{\log_2 3}) multiplication algorithm at Kolmogorov's seminar, refuting the presumed quadratic lower bound.
1962
Karatsuba and Kolmogorov publish the result.
1963
Toom introduces a generalization (later refined by Cook) splitting into kk parts instead of 2, trading more overhead for a better exponent as kk grows — the Toom-Cook family.
1971
Schönhage and Strassen give an O(nlog⁡nlog⁡log⁡n)O(n \log n \log\log n) algorithm using fast Fourier transform-based convolution, a landmark in the pursuit of near-linear multiplication.
2019
Harvey and van der Hoeven publish an O(nlog⁡n)O(n \log n) integer-multiplication algorithm, matching a long-conjectured lower bound, closing a chapter opened by Karatsuba's discovery six decades earlier.

Where this matters

Arbitrary-precision arithmetic libraries — GMP (GNU Multiple Precision Arithmetic Library), Python's built-in big integers, Java's `BigInteger`, and the arithmetic cores of computer algebra systems like Mathematica and Maple — all implement a hybrid dispatch strategy: schoolbook multiplication for small operands, Karatsuba for medium-sized operands, Toom-Cook variants for larger ones, and FFT-based methods (Schönhage-Strassen or newer variants) for the largest. Karatsuba's algorithm is typically the first asymptotic improvement such libraries reach for once numbers exceed a few dozen machine words. Cryptographic systems that rely on large-integer or large-polynomial arithmetic — RSA key generation and modular exponentiation, elliptic-curve cryptography's underlying field arithmetic, and homomorphic encryption schemes operating over large polynomial rings — benefit directly from subquadratic multiplication, since these operations perform enormous numbers of large-integer multiplications and even modest asymptotic improvements translate into real wall-clock savings at scale. Record-setting computations of π\pi and other mathematical constants to trillions of digits depend on fast multiplication (typically FFT-based methods derived from the same divide-and-conquer lineage Karatsuba began). Polynomial multiplication — used in signal processing, error-correcting codes, and symbolic computation — is structurally identical to integer multiplication (treat digits as polynomial coefficients), so Karatsuba's trick applies verbatim there as well, illustrating how the same Divide and Conquer Paradigm idea recurs across disparate application domains. Understanding Karatsuba is also a natural stepping stone toward The Greedy Method and Optimal Substructure, where a different strategy — commit locally, prove no backtracking is needed — replaces the "split, recurse, cleverly recombine" strategy at the heart of divide-and-conquer.

Ask the tutor: How would the recurrence and exponent change if we split each number into three parts instead of two, using five multiplications (as in Toom-3)?

Is Karatsuba's algorithm the fastest known way to multiply integers?

No. Karatsuba was the first subquadratic algorithm, but it was superseded asymptotically by Toom-Cook (splitting into more than 2 parts), then by Schönhage-Strassen's O(nlog⁡nlog⁡log⁡n)O(n\log n\log\log n) FFT-based method, and ultimately by Harvey and van der Hoeven's 2019 algorithm achieving O(nlog⁡n)O(n\log n), matching a conjectured lower bound. In practice, however, Karatsuba remains widely used for medium-sized operands because its overhead is far smaller than FFT-based methods, which only pay off for extremely large numbers (thousands of digits or more). Real libraries dispatch among several algorithms based on operand size.

Why is the Master Theorem's Case 1 the relevant case here, intuitively?

Case 1 applies when the combining work f(n)f(n) is asymptotically smaller than nlog⁡ban^{\log_b a}, meaning the total work is dominated by the sheer number of leaves in the recursion tree rather than by the work done at the root. Here f(n)=O(n)f(n) = O(n) is linear, while nlog⁡23≈n1.585n^{\log_2 3} \approx n^{1.585} grows faster. Concretely, the recursion tree has 3k3^k subproblems at depth kk, each shrinking by half; because 3>23 > 2, the branching factor outpaces the size reduction, so the leaves (base cases) collectively dominate the runtime, not the top-level combine step.

Does Karatsuba's algorithm work for polynomial multiplication too?

Yes, directly and without modification to the core idea. Treat polynomial coefficients as the "digits" of a base-BB representation (with BB symbolic rather than numeric), split each polynomial into a high-degree half and a low-degree half, and apply the identical identity: (x1+x0)(y1+y0)−x1y1−x0y0(x_1+x_0)(y_1+y_0) - x_1y_1 - x_0y_0 recovers the cross terms. This is one reason Karatsuba's trick generalizes so widely — it is really a statement about bilinear algebra over any commutative ring, not specifically about base-10 or base-2 numerals.

What is the actual crossover point where Karatsuba beats schoolbook multiplication in practice?

It varies by implementation, hardware, and how well-optimized the schoolbook inner loop is, but production libraries like GMP typically switch to Karatsuba somewhere in the range of a few dozen to roughly one hundred machine words (each word being 32 or 64 bits), and switch again to Toom-Cook or FFT-based methods at larger sizes still. The exact thresholds are determined empirically by benchmarking on target hardware, not derived purely from asymptotic analysis, since constant factors and memory-access patterns matter enormously at these scales.

How does Toom-Cook generalize Karatsuba's idea?

Karatsuba splits each number into 2 parts and uses 3 multiplications instead of 4 (i.e., 2k−12k-1 multiplications for k=2k=2 parts). Toom-Cook generalizes this to splitting into kk parts, using 2k−12k-1 multiplications instead of k2k^2, by evaluating the numbers (viewed as polynomials) at 2k−12k-1 points, multiplying pointwise, and interpolating. As kk grows, the exponent in the resulting recurrence approaches 1, but the overhead (evaluation and interpolation cost, coefficient growth) increases, so in practice only small kk (Toom-3, Toom-4) are used before switching to FFT-based methods entirely.

Why is exact carry/borrow handling more delicate in Karatsuba than in schoolbook multiplication?

Schoolbook multiplication processes digit pairs directly and carries are handled digit-by-digit in a single predictable pass. Karatsuba, by contrast, computes intermediate quantities like z1−z2−z0z_1 - z_2 - z_0 that can be negative even though the final assembled result is positive, and it computes x1+x0x_1+x_0, which can overflow the expected digit width. An implementation must track signs and allocate one extra digit of headroom for these intermediate values, or subtle, input-dependent corruption can occur that ordinary schoolbook code would never produce.

Does Karatsuba's algorithm reduce the number of additions too, or only multiplications?

No — it strictly increases the number of additions/subtractions (from the naive combine step's roughly 2 additions to about 6 operations: two additions to form sx,sys_x, s_y, one multiplication, and two subtractions to isolate the middle term, plus final shift-adds). This is precisely the tradeoff: Karatsuba spends more linear-time work (additions, which cost O(n)O(n)) to save one multiplication (which, recursively, costs far more). Since multiplication is the asymptotically expensive operation, trading multiplications for additions is a net win once nn is large enough to make the recursion pay off.

Before this

Where this leads