Numerical Methods in Engineering
ENGG222, Spring 2025
Chapter 3
Relative and Absolute Errors, Round-off Errors
Ramin Masoudi
Associate Professor of the Department of Mechanical Engineering
American University in Dubai
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 1
INTRODUCTION
For many engineering problems, we cannot obtain analytical solutions
Numerical methods yield approximate results; results that are close to
the exact analytical solution
All numerical methods involve approximations due to either limits in
the algorithm or physical limits in the computer hardware.
Errors associated with measurements or calculations can be
characterized with reference to accuracy and precision
How confident we are in our approximate result?
The question is
“How much error is present in our calculation and is it tolerable?”
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 2
ACCURACY AND PRECISION
Accuracy: How close is a computed or measured
value to the true value
Precision (or reproducibility): How close is a
computed or measured value to previously
computed or measured values.
Inaccuracy (or bias): A systematic deviation
from the actual value.
Imprecision (or uncertainty): Magnitude of
scatter.
(a) inaccurate and imprecise (b) accurate and imprecise
(c) inaccurate and precise (d) accurate and precise
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 3
SIGNIFICANT FIGURES
Number of significant figures, or digits, indicates precision.
Significant digits of a number are those that can be used with confidence,
e.g., the number of certain digits plus one estimated digit.
53,800 How many significant figures?
5.38 × 104 3
5.380 × 104 4
5.3800 × 104 5
Zeros are sometimes used to locate the decimal point not significant figures.
0.00001753 4
0.0001753 4
0.001753 4
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 4
ERROR DEFINITIONS
There are a number of ways to describe errors in measurements and
calculations. The simplest ones are the true and absolute errors.
True error ( 𝐸𝐸𝑡𝑡 ): the difference between the true value and the
approximation:
𝐸𝐸𝑡𝑡 = true value – approximation
Absolute error ( 𝐸𝐸𝑡𝑡 ): the absolute difference between the true value and
the approximation:
𝐸𝐸𝑡𝑡 = |true value – approximation|
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 5
True fractional relative error
True percent relative error
For numerical methods, the true value will be known only when we deal with
functions that can be solved analytically (simple systems). In real world applications,
we usually not know the answer a priori. Then
True value will be replaced with
an approximated value
Percent relative error
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 6
For Example, Iterative Approach in numerical methods
• A present approximation is made on the basis of a previous approximation
• This process is performed repeatedly, or iteratively, to successively compute
(hopefully) better and better approximations
• Use absolute value for the error
• Computations are repeated until stopping criterion is satisfied
a prespecified tolerance
Ex. Animation for Newton’s method in finding roots for algebraic equations
[Link]
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 7
Note: One can be sure that the result is correct to at least 𝑛𝑛 significant figures if:
Sample Problem: In mathematics, functions can often be represented by infinite series. For
example, the exponential function can be computed using
Estimate 𝑒𝑒 0.5 to ensure that the results are correct to at least three significant figures. The true
value for 𝑒𝑒 0.5 = 1.648721.
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 8
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 9
ROUNDOFF ERRORS
Digital computers have size and precision limits on their
ability to represent numbers
Numbers such as π = 3.141592653589793238462643 … cannot be
expressed by a fixed number of significant figures. The
omission of the remaining significant figures is called round-
off error
Computers use a base-𝟐𝟐 representation, they cannot precisely
represent certain exact base-𝟏𝟏𝟏𝟏 numbers
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 10
Computer Number Representation
Fractional quantities are typically represented in computer
using “floating point” form, e.g.,
Integer part
exponent
[Link]
mantissa
Base of the number system
11
Integer Representation, Signed magnitude method
Ex. Representation of the decimal integer −173 on
a 16-bit computer using the signed magnitude
method.
Floating-Point Representation, Floating-point form
𝑚𝑚. 𝑏𝑏 𝑒𝑒
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 12
Ex. Floating-point representation:
(1) 156.78 in a floating point base-10 system → 0.15678 × 103
1
(2) For the number = 0.029411765, 0.0294 × 100
34
suppose only 4 decimal places to be stored
Normalizing to remove the leading zeroes. Multiply the
mantissa by 10 and lower the exponent by 1, we get
0.2941 × 10−1
Additional significant figure is retained
The consequence of normalization is that the absolute value of 𝑚𝑚 is limited
1
≤ 𝑚𝑚 < 1
𝑏𝑏
ENGG222: Numerical Methods in Engineering Dr. Ramin Masoudi, Mechanical Engineering 13