Computer Algebra & Symbolic Computation

expression swell

You set a computer-algebra system a clean problem with a clean answer, and somewhere in the middle the machine grinds to a halt or runs out of memory — even though both the input and the final result are small. The villain is expression swell: the tendency of EXACT intermediate results to grow explosively in size, even when the start and end are modest. It is the single most important practical limitation of symbolic computation.

Why does keeping things exact cost so much? Because exactness forbids the rounding that would otherwise keep numbers small. In exact rational arithmetic, repeated operations pile up enormous numerators and denominators before a final GCD reduction shrinks them back. In a naive polynomial GCD over the rationals the intermediate coefficients balloon dramatically even though the answer is tiny. Solving a polynomial system via a Groebner basis can produce intermediate polynomials of doubly-exponential size. The pattern is universal: a numerical method would round at every step and stay the same size, but a symbolic method must carry every exact digit and symbol forward, and those accumulate. The classic image is a fraction-free Gaussian elimination where the entries grow geometrically with each pivot.

Expression swell is why 'just do it exactly' is rarely a free upgrade over numerics, and why a CAS can be brilliant on a small instance yet hopeless one size up. The cures are the cleverness of computer algebra: keep fractions reduced; use subresultant methods to bound GCD coefficient growth; and above all use modular and p-adic techniques — compute the answer modulo several primes (where numbers stay small and bounded) and reconstruct the exact result by the Chinese Remainder Theorem or Hensel lifting, sidestepping the swollen intermediates entirely. Probabilistic and hybrid symbolic-numeric methods chase the same goal. Recognizing and defusing expression swell is most of the art of practical symbolic computation.

Run a naive (fraction-bearing) Gaussian elimination on a 10-by-10 matrix of small integers, kept exact. The pivots produce fractions whose numerators and denominators grow with almost every step, so the intermediate matrix can hold numbers thousands of digits long — even though the final exact solution has small entries. Fraction-free elimination or a modular method keeps the giants from ever appearing.

Tiny input and output, monstrous middle — the hallmark of expression swell.

Expression swell is not a bug to be patched away — it is intrinsic to demanding exactness. You manage it (reduced fractions, subresultants, modular/p-adic reconstruction), you do not eliminate it. When swell makes a symbolic computation infeasible, switching to a numerical or hybrid method is often the only realistic option.

Also called
intermediate expression swellcoefficient growth中間表達式膨脹係數膨脹