Content deleted Content added
more precisely |
m →History: Removed erroneous space and general fixes (task 1) |
||
(23 intermediate revisions by 19 users not shown) | |||
Line 1:
{{short description|Act of performing an initial computation before run time}}
[[Image:Abramowitz&Stegun.page97.agr.jpg|thumb|Part of a 20th-century precomputed [[mathematical table]] of [[common logarithm]]s.]]
In [[algorithms]], '''precomputation''' is the act of performing an initial [[computation]] before [[Run time (program lifecycle phase)|run time]] to generate a [[lookup table]] that can be used by an algorithm to avoid repeated computation each time it is executed. Precomputation is often used in algorithms that depend on the results of expensive computations that don't depend on the input of the algorithm. A trivial example of precomputation is the use of [[hardcoded]] mathematical constants, such as [[Pi|π]] and [[E (mathematical constant)|e]], rather than computing their approximations to the necessary precision at run time.
In [[database]]s, the term '''materialization''' is used to refer to storing the results of a precomputation
== Overview ==
Line 9 ⟶ 10:
== History ==
Before the advent of computers, printed [[lookup table]]s of values were used by people to speed up hand calculations of complex functions, such as in [[trigonometric table]]s, [[Common logarithm|logarithm tables]], and tables of [[statistical density function]]s.<ref>{{cite book
|editor1-last= Campbell-Kelly
|editor1-first= Martin|editor1-link=Martin Campbell-Kelly
|editor2-last= Croarken
|editor2-first= Mary|editor2-link=Mary Croarken
|editor3-last= Flood|editor3-link=Raymond Flood (mathematician)
|editor3-first= Raymond
|display-editors = 3 |editor4-last= Robson|editor4-link=Eleanor Robson
|
|title= The History of Mathematical Tables From Sumer to Spreadsheets
|title-link= The History of Mathematical Tables
▲|origyear= 2003
|publisher= Oxford University Press
|isbn= 978-0-19-850841-0
}}
</ref>
School children are often taught to memorize "[[times table]]s" 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 ==
Line 55 ⟶ 46:
* [[Algorithmic efficiency]]
* [[Partial evaluation]]
* [[
== References ==
|