DEN: Errors in calculations Definition. Let x be a number and x its

ODE and num. math.: Errors in calculations [lectures]
c pHabala 2016
DEN: Errors in calculations
Definition.
Let x be a number and x̂ its estimate. Then we define the absolute error Ex = x − x̂ and the relative
x|
error εx = |E
|x| .
By an error estimate we mean any number ex satisfying |Ex | ≤ ex .
floating point representation of a number with respect to base β, with precision of p significant digits:
d1 .d2 d3 · · · dp × β e ,
where d1 ∈ {1, . . . , β − 1} and d2 , . . . , dp ∈ {0, 1, . . . , β − 1}.
p: precision, β: base, e: exponent, d1 .d2 · · · dp : significand.
Fact.
Assume that a number x was represented as x̂ in floating point representation with base β and precision
p. Then the relative error is bounded as follows:
εx ≤
1
β · β −p
2
Fact.
Consider real numbers x, y and their estimates x̂, ŷ. Then the following are true:
|Ex+y | ≤ |Ex | + |Ey |
εx+y ≤ max(εx , εy ) for x, y > 0;
|Ex−y | ≤ |Ex | + |Ey |
x+y
εx−y ≤ max(εx , εy ) |x−y|
for x, y > 0;
|Ex·y | ≤ |y| · |Ex | + |x̂| · |Ey |
|Ex/y | ≤ y1 Ex + Ey x̂ŷ
εx·y ≤ εx + (1 + εx )εy ;
|E1/x | ≤ xx̂ Ex
ε1/x ≤ xx̂ εx .
εx/y ≤ εx + εy x̂x ŷy ;
1
ODE and num. math.: Errors in calculations [lectures]
Fact.
Assume that there is a rounding error ε > 0 on input, then for x, y > 0 we have
εax+y ≤ ε,
x+y
εx−y ≤
ε,
|x − y|
εx·y ≤ 2ε,
εx/y ≤ 2ε,
ε1/x = ε.
2
c pHabala 2016
ODE and num. math.: Errors in calculations [lectures]
c pHabala 2016
Definition. Consider a number a ∈ IR, or a = ±∞, let f, g be functions defined on some (reduced)
neighborhood of a.
We say that f ∈ O(g) as x → a if there exist some constant C and a reduced neighborhood P of a such
that |f | ≤ C|g| on P .
Fact.
If 0 < a ≤ b and β ∈ IR, then βhb = O(ha ) as h → 0, resp. h → 0+ .
Fact.
(i) For 0 < a ≤ b and α, β ∈ IR: αO(ha ) ± βO(hb ) = O(ha ) as h → 0.
b
(ii) For a, b ≥ 0: O(ha ) · O(h
) = O(ha+b ) as h → 0
(iii) For a ≥ b ≥ 0: O(ha ) hb = O(ha−b ) as h → 0.
3