100% found this document useful (1 vote)
1K views4 pages

Error Calculations in Numerical Analysis: Absolute and Relative Errors

The document discusses error calculations in numerical analysis. It defines absolute error as the difference between the true and approximate values, and relative error as the absolute error divided by the true value. Absolute error measures the size of the error, while relative error accounts for the order of magnitude by expressing error as a fraction of the true value. Errors from operations like addition, subtraction, multiplication and division propagate and their magnitudes can be estimated based on the individual errors.

Uploaded by

nazrin sultana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views4 pages

Error Calculations in Numerical Analysis: Absolute and Relative Errors

The document discusses error calculations in numerical analysis. It defines absolute error as the difference between the true and approximate values, and relative error as the absolute error divided by the true value. Absolute error measures the size of the error, while relative error accounts for the order of magnitude by expressing error as a fraction of the true value. Errors from operations like addition, subtraction, multiplication and division propagate and their magnitudes can be estimated based on the individual errors.

Uploaded by

nazrin sultana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Numerical Methods L4_Error calculations

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)

The error may be positive or negative depending on the values of 𝑥𝑡 and 𝑥𝑎 .

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)

Problem-1: An approximate value of π is given by 3.1428571 and its true value is


3.1415926. Find the absolute, relative and per cent errors.

Solution: Absolute error, 𝑒𝑎 = |𝑥𝑡 − 𝑥𝑎 | = |3.1415926 − 3.1428571| = 0.0012645


𝑒 0.0012645
Relative error, 𝑒𝑟 = |𝑥𝑎| = 3.1415926 = 0.000402.
𝑡

Per cent error =𝑒𝑟 × 100 = 0.000402 × 100 = 0.04%.

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.

Solution: In measuring the building height

Absolute error, 𝑒𝑎1 = |2945 − 2950| = 5 cm


5
Relative error, 𝑒𝑟1 = 2945 = 0.0017 = 0.17%.

In measuring the beam height

Absolute error, 𝑒𝑎2 = |30 − 35| = 5 cm


5
Relative error, 𝑒𝑟2 = 30 = 0.17 = 17%.

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

Numerical calculations involve a series of computations consisting of basic


arithmetic operations (i.e. addition, subtraction, multiplication, division).

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

A. Total error for addition and subtraction

Addition: 𝑥𝑡 + 𝑦𝑡 = (𝑥𝑎 + 𝑒𝑥 ) + (𝑦𝑎 + 𝑒𝑦 ) = (𝑥𝑎 + 𝑦𝑎 ) + (𝑒𝑥 + 𝑒𝑦 )

Therefore, the total error for addition, 𝑒𝑥+𝑦 = 𝑒𝑥 + 𝑒𝑦

Similarly, the total error for subtraction, 𝑒𝑥−𝑦 = 𝑒𝑥 − 𝑒𝑦

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.

B. Total error for multiplication and division

Multiplication: 𝑥𝑡 × 𝑦𝑡 = (𝑥𝑎 + 𝑒𝑥 ) × (𝑦𝑎 + 𝑒𝑦 ) = 𝑥𝑎 𝑦𝑎 + 𝑦𝑎 𝑒𝑥 + 𝑥𝑎 𝑒𝑦 + 𝑒𝑥 𝑒𝑦

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: 𝑒𝑟, 𝑥±𝑦 ≤ |𝑥𝑎 ±𝑦𝑎 |
.

Multiplication and Division: 𝑒𝑟, 𝑥𝑦 = |𝑒𝑟,𝑥 | + |𝑒𝑟,𝑦 |

And 𝑒𝑟, 𝑥/𝑦 = |𝑒𝑟,𝑥 | + |𝑒𝑟,𝑦 |.

3
Numerical Methods L4_Error calculations

Machine Epsilon:

We know that the length of mantissa d is machine dependent. The machine


epsilon represents the upper bound for the roundoff error due to floating point
representation.

For a number x represented in a computer, the absolute error is given by


1
𝑒𝑥 = |𝑥| × 𝜀, where, 𝜀 = 2 × 10−𝑑 .

Problem-4: Find the absolute error in 𝒘 = 𝒙𝒚 + 𝒛 if x = 2.35, y = 6.74 and z


= 3.45.

Solution: 𝑒𝑥 = 2.35 × 0.5 × 10−2 = 0.01175;

𝑒𝑦 = 6.74 × 0.5 × 10−2 = 0.03370

And 𝑒𝑧 = 3.45 × 0.5 × 10−2 = 0.01725.

Therefore, 𝑒𝑥𝑦 = |𝑥|𝑒𝑦 + |𝑦|𝑒𝑥 = 2.35 × 0.03370 + 6.74 × 0.01175 = 0.15839.

Therefore, 𝑒𝑤 = |𝑒𝑥𝑦 | + |𝑒𝑧 | = 0.15839 + 0.01725 = 0.17564. (Ans.)

Problem-5: Compute the absolute and relative errors in 𝒘 = 𝒙 + 𝒚 + 𝒛, where


x = 9678, y = 678 and z = 78 assuming the length of mantissa is four.

Solution:

The true value is 𝑤𝑡 = 𝑥 + 𝑦 + 𝑧 = 9678 + 678 + 78 = 10444.

Now taking the 4 significant decimal digits, the approximate value becomes

𝑤𝑎 = (0.9678 + 0.0678 + 0.0078) × 104

= 1.0434 × 104 = 10434.

Therefore, the absolute is 𝑒𝑤 = 10444 − 10434 = 10


10
and the relative error is 𝑒𝑟,𝑤 = 10444 = 9.6 × 10−4 (Ans.)

You might also like