Content deleted Content added
m I added some extra links and made some passages more interesting Tags: Reverted Visual edit Disambiguation links added Newcomer task |
Undid revision 1250111571 by ClonicalClone (talk) not a minor edit, 1st paragraph is WP:CHATGPT, body paragraphs violate MOS:NOTED |
||
Line 2:
{{redirect-distinguish|Absolute error|Absolute deviation}}
{{broader|Approximation}}
[[File:E^x with linear approximation.png|thumb|
The '''
An approximation error can occur for a variety of reasons, among them a computing [[machine precision]] or [[measurement error]] (e.g. the length of a piece of paper is 4.53 cm but the ruler only allows you to estimate it to the nearest 0.1 cm, so you measure it as 4.5 cm).
In the [[mathematics|mathematical]] field of [[numerical analysis]], the [[numerical stability]] of an [[algorithm]] indicates the extent to which errors in the input of the algorithm will lead to large errors of the output; numerically stable algorithms do not yield a significant error in output when the input is malformed and vice versa.<ref>{{Cite web |last=Weisstein |first=Eric W. |title=Numerical Stability |url=https://mathworld.wolfram.com/ |access-date=2023-06-11 |website=mathworld.wolfram.com |language=en}}</ref>
Line 31:
==Examples==
{{Diophantine_approximation_graph.svg}}
The relative error is often used to compare approximations of numbers of widely differing size; for example, approximating the number 1,000 with an absolute error of 3 is, in most applications, much worse than approximating the number 1,000,000 with an absolute error of 3; in the first case the relative error is 0.003 while in the second it is only 0.000003.
There are two
== Comparison ==
Line 43 ⟶ 41:
== Polynomial-time approximation of real numbers ==
We say that a real value ''v'' is '''polynomially computable with absolute error''' from an input if, for every rational number ''ε''>0, it is possible to compute a rational number ''v''<sub>approx</sub> that approximates ''v'' with absolute error ''ε'', in time polynomial in the size of the input and the encoding size of ''ε'' (which is O(log(1/''ε'')). Analogously, ''v'' is '''polynomially computable with relative error''' if, for every
If ''v'' is polynomially computable with relative error (by some algorithm called REL), then it is also polynomially computable with absolute error. ''Proof''. Let ''ε''>0 be the desired absolute error. First, use REL with relative error ''η=''1/2; find a rational number ''r''<sub>1</sub> such that |''v''-''r''<sub>1</sub>| ≤ |''v''|/2, and hence ''|v|'' ≤ 2 |''r''<sub>1</sub>|. If ''r''<sub>1</sub>=0, then ''v''=0 and we are done. Since REL is polynomial, the encoding length of ''r''<sub>1</sub> is polynomial in the input. Now, run REL again with relative error ''η=ε/''(2 ''|r''<sub>1</sub>|). This yields a rational number ''r''<sub>2</sub> that satisfies |''v''-''r''<sub>2</sub>| ≤ ''ε|v''| / (2''r''<sub>1</sub>) ≤ ''ε'', so it has absolute error ''ε'' as wished.<ref name=":02" />{{Rp|page=34}}
|