Lecture 7 - Numerical Errors Flashcards
Absolute and relative errors, floating points, round-off errors, input data errors, truncation errors
Absolute error
Δx = x - x’
where:
x - accurate value
x’ - approximated one
Relative error
𝛿x = (Δx)/x
often expressed in percentage => 𝛿x * 100%
Floating points
Real numbers are stored in most modern digital machines in the so-called form floating point.
They form a subset of the R file, denoted as F
They are defined as:
x = M * N^W
M - mantissa
W - exponent
usually N = 2
The real number is thus represented by two groups of bits
Two important restrictions:
- Represented numbers cannot be arbitrarily large/small
- There is a space between numbers representation
IEEE 754 Standard
SINGLE PRECISION
- > 32 bits
- > 23 mantissa
- > 8 exponent
DOUBLE PRECISION
- > 64 bits
- > 52 mantissa
- > 11 exponent
- > biggest number 1.79 * 10e308
- > smallest number 2.23 * 10e-308
- > the resolution of a subset F is represented by the machine epsilon Em =~ 2 ^ (-52)
Arithmetic / Wilkinson lemma
All mathematical operation performed on a computer can be represented by elementary operation + - * /
However in floating-point arithmetic we use the F space in which analogous operations exists e.g.:
x +’ y = fl(x+y)
Wilkinson Lemma: every elementary operation in F: +' -' *' /' introduced given error x +' y = x(1+e) + y(1+e) x -' y = x(1+e) - y(1+e) x *' y = xy(1+e) x /' y = (x/y)(1+e) where e < Em Conclusion: Each arithmetic operation in the space F is performed with an accuracy of relative error less or equal them Em -> This fact causes an ROUND-OFF ERRORS
Input data errors
Data error- an error that is caused by the input data of numeric tasks.
Origins:
-> measurement errors
-> errors from the previous calculation phase
-> replacing the values of constant that are non-measurable numbers approximations
Even SMALL errors in the input data can result in LARGE relative error of the result
Truncation errors
Difference between the true derivative of a function and its derivative obtained by numerical approximation
Examples:
- > approximation of the infinite sum of series with the sum of the finite number of its elements
- > approximation of the derivative with the finite differences
- > approximation of the integral with a finite sum