Precomputation

Source: Wikipedia, the free encyclopedia.
Part of a 20th-century precomputed mathematical table of common logarithms.

In

hardcoded mathematical constants, such as π and e
, rather than computing their approximations to the necessary precision at run time.

In databases, the term materialization is used to refer to storing the results of a precomputation,[1][2] such as in a materialized view.[3][4]

Overview

Precomputing a set of intermediate results at the beginning of an algorithm's execution can often increase

interpolating
for intermediate input values, since interpolation is also a linear operation.

History

Before the advent of computers, printed

statistical density functions[5]
School children are often taught to memorize "
times tables" to avoid calculations of the most commonly used numbers (up to 9 x 9 or 12 x 12). Even as early as 493 A.D., Victorius of Aquitaine wrote a 98-column multiplication table which gave (in Roman numerals) the product of every number from 2 to 50 times and the rows were "a list of numbers starting with one thousand, descending by hundreds to one hundred, then descending by tens to ten, then by ones to one, and then the fractions down to 1/144" [6]

Examples

Even modern computer implementations of digital

trigonometric functions often use precomputed lookup tables to either provide coefficients for interpolation algorithms or to initialise successive approximation algorithms
.

Many attacks on cryptosystems involve precomputation.

Examples of large-scale precomputation as part of modern efficient algorithms include:

  • Rainbow tables
  • Perfect hashes
  • The cube attack
  • Precalculated
    BSP trees
    for visibility calculations in 3D graphics
  • Radiosity
    precomputation for illumination in 3D graphics

dataflow analysis and strength reduction
steps.

See also

References

  1. .
  2. .
  3. .
  4. .
  5. .
  6. ^ Maher, David. W. J. and John F. Makowski. "Literary Evidence for Roman Arithmetic With Fractions", 'Classical Philology' (2001) Vol. 96 No. 4 (2001) pp. 376–399. (See page p. 383.)