Floating Point Number Systems 1
1.3 Floating Point Number Systems
1. Provide the floating point equivalent for each of the following numbers from the
floating point number system F(10,4,0,4). Consider both chopping and round-
ing. Compute the absolute and relative error in each floating point equivalent.
(a) π(b) e
(c) 2(d) 1/7
(e) cos 22(f) ln 10
(g) 3
9
In the following table, δdenotes the absolute error and ǫthe relative error.
Chopping Rounding
yfl(y)error fl(y)error
cos 220.9271 δ= 8.385 ×1050.9272 δ= 1.615 ×105
2. Prove the bounds on the absolute and relative roundoff error associated with
rounding:
|flround(y)y| ≤ 1
2βekand |flround(y)y|
|y|1
2β1k.
Consider the floating point system F(β, k, m, M)with rounding. Let ybe a real
number whose expansion is given by
2Section 1.3
2βek.
Provided y6= 0, given the restriction on d1,
3. Show that machine precision is the smallest floating point number, v, such that
fl(1 + v)>1.
First consider the floating point number system F(β, k, m, M)with chopping. The
number one is represented by the expansion
If we let
Floating Point Number Systems 3
4. (a) Construct an algorithm to determine machine precision and another algo-
rithm to determine the smallest positive number of a floating point number
system.
(b) Implement the algorithms from part (a) to determine machine precision
and the smallest positive number on your computing system. Consider
both single and double precision.
(c) Assuming that your computing system uses β= 2 and rounding, use the
results from part (b) to determine the values for kand m.
(a) Assuming the floating point system uses rounding, here is an algorithm to
Here is an algorithm to determine the smallest positive number, assuming that
underflow is handled by setting the value to zero.
GIVEN: base β
4Section 1.3
5. Determine machine precision, the smallest positive number and the largest pos-
itive number for the floating point number system used by your calculator.
Assuming the calculator uses β= 10, determine the values for k,mand M.
Answers will of course vary. On a Casio fx 300SA, machine precision is 5×
6. Determine the number of significant decimal digits and the number of significant
binary digits to which each of the following pairs of numbers agree.
(a) 355/113 and π
(b) 685/252 and e
(c) 10002 and 10001
(d) 103/280 and 1/e
(a) Because
(b) Because
685
252 e
Floating Point Number Systems 5
(c) Because
(d) Because
7. The ideal gas law states that P V =nRT , where Pis the pressure of the gas, V
is the volume, nis the number of moles, Tis the temperature and R= 0.08206
atm·m3/moles·K is the universal gas constant.
(a) Experimentally, it has been determined that P= 0.750 atm, V= 1.15 m3
and T= 294.1K. Assuming that all values have been rounded to the digits
shown, in what range of values does nfall?
(b) Experimentally, it has been determined that V= 0.331 m3,n= 0.00712
moles and T= 264.7K. Assuming that all values have been rounded to the
digits shown, in what range of values does Pfall?
6Section 1.3
(a) With
0.7495 atm < P < 0.7505 atm
(b) With
0.3305 m3< V < 0.3315 m3
8. In a physics laboratory, students measure the mass of a rectangular block to be
243.27 ±0.005 grams. The length, width and depth of the block are measured
to be 7.8±0.05 cm, 3.1±0.05 cm and 4.2±0.05 cm, respectively.
(a) In what range of values does the volume of the block fall?
(b) In what range of values does the density of the block fall? Density is mass
per unit volume.
(a) With
7.75 cm <length <7.85 cm
(b) Density is defined as mass per unit volume. It is given that
9. Students are using a pendulum to experimentally determine the acceleration
due to gravity, g. They measure the period, T, of the pendulum to be 2.2
seconds, and the length, l, of the pendulum to be 1.15 meters. Assuming that
all values are correct to the digits shown, in what range of values does gfall?
The variables in this problem are related by the formula T= 2πpl/g.
10. Determine machine precision, the smallest positive number and the largest posi-
tive number in the IEEE standard double precision system. Approximately how
many significant decimal digits does the double precision standard supply?
With β= 2 and k= 53, machine precision with rounding is
11. In addition to the standard single and double precision floating point systems,
Intel microprocessors also have an extended precision system F(2,64,16381,16384).
Determine machine precision, the smallest positive number and the largest pos-
itive number for this extended precision system.
8Section 1.3
12. IBM System/390 mainframes provide three floating point number systems: short
precision F(16,6,64,63), long precision F(16,14,64,63) and extended preci-
sion F(16,28,64,63). Compare machine precision, the smallest positive num-
ber and the largest positive number for each of these number systems.
In the short precision system F(16,6,64,63), machine precision with rounding is
13. A common floating point number system used on modern calculators is
F(10,10,98,100). Determine machine precision, the smallest positive num-
ber and the largest positive number for this extended precision system.
With β= 10 and k= 10, machine precision with rounding is
Floating Point Number Systems 9
14. (a) Show that the number of elements in the set F(β, k, m, M ) is given by
1 + 2(β1)βk1(Mm+ 1).
(b) How many elements are in the IEEE standard single precision number
system?
(c) How many elements are in the IEEE standard double precision number
system?
(a) Let’s start by counting the number of positive elements in F(β, k, m, M).
The only restriction on the mantissa is that the first digit cannot be zero;
15. Consider the function f(x) = x24x+ 4.
(a) What are the zeros of f?
10 Section 1.3
(b) Suppose we were to change the constant term to 4 108. What are
the zeros of this new function? Relative to the size of the change in the
constant term, how big is the change in the zeros of the function?
(c) Now, suppose we were to change the constant term to 4 + 108. What are
the zeros of this new function? Relative to the size of the change in the
constant term, how big is the change in the zeros of the function?
(c) Finally, consider the function f(x) = x24x+ (4 + 108). By the quadratic
formula, the zeros of this new function are
16. Consider the linear, first-order differential equation
dx
dt +1
tx=sin t
t.
(a) Solve this equation subject to the initial condition x(π/2) = x0.
(b) Solve this equation subject to the perturbed initial condition x(π/2) =
x0+ǫ.
(c) By considering the difference between the solutions obtained in parts (a)
and (b), comment on the conditioning of this problem.
Floating Point Number Systems 11
(b) The general solution to the differential equation remains
(c) The difference between the solutions obtained in parts (a) and (b) is
17. Consider the linear, first-order differential equation
dx
dt 1
tx=tsin t.
(a) Solve this equation subject to the initial condition x(π/2) = x0.
(b) Solve this equation subject to the perturbed initial condition x(π/2) =
x0+ǫ.
12 Section 1.3
(a) Multiplying
where Cis a constant of integration. Using the initial condition x(π/2) = x0,
(b) The general solution to the differential equation remains
(c) The difference between the solutions obtained in parts (a) and (b) is
18. Consider the linear system of equations
1.1 2.1
2 3.8 x
y=b.
Floating Point Number Systems 13
(a) Solve the system for the right-hand side vector b=3.2 5.8T.
(b) Solve the system for the right-hand side vector b=3.21 5.79 T.
(c) Solve the system for the right-hand side vector b=3.1 5.7T.
(d) By considering the difference between the solutions obtained in parts (a),
(b), and (c), comment on the conditioning of this problem.
(a) The system of equations is