Error Calculations in Numerical Analysis: Absolute and Relative Errors
Error Calculations in Numerical Analysis: Absolute and Relative Errors
Regardless of its source, an error usually calculated in two different but related
ways. One is known as the absolute error and the other is called relative error.
Absolute error is the numerical difference between the true value of a quantity
and its approximate value. Thus, if 𝑥𝑡 is the true value of a quantity and 𝑥𝑎 is its
approximate value, then the absolute error 𝑒𝑎 is given by
𝑒𝑎 = 𝑥𝑡 − 𝑥𝑎 … .. . (4.1)
In error analysis, what is important is the magnitude of the error and not the
sign and, therefore, the absolute error is normally denoted as
𝑒𝑎 = |𝑥𝑡 − 𝑥𝑎 | … .. . (4.2)
In many cases, absolute error may not reflect its influence correctly as it does
not take into account the order of magnitude of the value under study. In view
of this, we introduce the concept of relative error that is defined as
|absolute error| |𝑥𝑡 −𝑥𝑎 |
𝑒𝑟 = |true value|
= |𝑥𝑡 |
… .. . (4.3)
The fractional form of 𝑒𝑟 can also be expressed as the per cent relative error as
|𝑥𝑡 −𝑥𝑎 |
Per cent 𝑒𝑟 = |𝑥𝑡 |
× 100 … .. . (4.4)
1
Numerical Methods L4_Error calculations
Problem-2: A civil engineer has measured the height of a 10 floor building as 2950
cm and the working height of each beam as 35 cm while the true values are 2945
cm and 30 cm, respectively. Compare their absolute and relative errors.
Although the absolute errors are the same, the relative error differ by 100 times.
𝟏
Problem-3: Three approximate values of the number are given as 0.30,
𝟑
0.33 and 0.34. Which of these three is the best approximation?
1 0.1
−0.30
Solution: We have, 𝑒𝑟1 =| 3
1 |= 3
1 = 0.1 ;
3 3
1 0.01
−0.33
𝑒𝑟2 =| 3
1 |= 3
1 = 0.01
3 3
1 0.02
−0.34
and 𝑒𝑟3 =| 3
1 |= 3
1 = 0.02
3 3
According to the above error calculations, the error for the approximate value
0.33 is the lowest. And, therefore, it follows that 0.33 is the best approximation
1
of 3.
Error Propagation
Our major concern, therefore, is how an error at one point in the process
propagates and how it affects the final total error.
Let us consider two numbers x and y. Their true values; approximate values;
and absolute errors are 𝑥𝑡 and 𝑦𝑡 ; 𝑥𝑎 and 𝑦𝑎 ; and 𝑒𝑥 and 𝑒𝑦 . Now, let us calculate
the total errors.
2
Numerical Methods L4_Error calculations
Note that the addition 𝑒𝑥 + 𝑒𝑦 does not mean that error will increase in all cases.
It depends on the sign of individual errors. Similar in the case with subtractions.
Since we do not normally know the sign of errors, we can only estimate error
bounds. That means, we can say that
The equation indicates that the magnitude of the absolute error of a sum (or
subtraction) is equal to or less than the sum of the magnitudes of the absolute
errors of the operands.
Errors are normally small and their products will be much smaller. Therefore, if
we neglect the product of the errors, we get
𝑒𝑥 𝑒𝑦
𝑥𝑡 × 𝑦𝑡 = 𝑥𝑎 𝑦𝑎 + 𝑥𝑎 𝑦𝑎 ( + )
𝑥𝑎 𝑦𝑎
𝑒 𝑒𝑦
Therefore, the total error for multiplication, 𝑒𝑥𝑦 = 𝑥𝑎 𝑦𝑎 (𝑥𝑥 + 𝑦 )
𝑎 𝑎
𝑥 𝑒 𝑒𝑦
Similarly, the total error for division, 𝑒𝑥/𝑦 = 𝑦𝑎 (𝑥𝑥 − 𝑦 )
𝑎 𝑎 𝑎
We can also have relative errors for all the four operations as follows:
|𝑒𝑥 |+|𝑒𝑦 |
Addition and Subtraction: 𝑒𝑟, 𝑥±𝑦 ≤ |𝑥𝑎 ±𝑦𝑎 |
.
3
Numerical Methods L4_Error calculations
Machine Epsilon:
Solution:
Now taking the 4 significant decimal digits, the approximate value becomes