Precomputation

A trivial example of precomputation is the use of hardcoded mathematical constants, such as π and e, rather than computing their approximations to the necessary precision at run time.

This becomes advantageous when one or more inputs is constrained to a small enough range that the results can be stored in a reasonably sized block of memory.

[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.

Examples of this sort of precomputation include dataflow analysis and strength reduction steps.

Part of a 20th-century precomputed mathematical table of common logarithms .