Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

DEPARTMENT OF MATHEMATICS

INDIAN INSTITUTE OF TECHNOLOGY DELHI


MTL107 (NUMERICAL METHODS AND COMPUTATION)
PRACTICE SHEET 2020-2021 FIRST SEMESTER

FLOATING POINT ARITHMETIC


1. Add the decimal numbers assuming 4 decimal digits.
(i) 9.999 × 101 and 1.610 × 10−1 .
(ii) 3.25 × 103 and 2.63 × 10−1 .

2. Add the two floating point numbers given in binary representation:


100 = 0 10000101 10010000000000000000000
0.25 = 0 01111101 00000000000000000000000.

3. True or false.
(i) Floating point addition is commutative.
(ii) Floating point addition is associative.
Given a = 1234.567, b = 45.67840 and c = 0.0004. Check if associative property holds or not (use
7-digit mantissa decimal arithmetic).

4. Consider the floating point system β = 10 and t = 4. Find f l(x − y), given that
x = 2.552 × 103 and y = 2.551 × 102 .
Verify that
f l(x − y) − (x − y) 1 −t+1

≤ β ,
(x − y) 2
where f l(x − y) is a t−digit rounded approximation to (x − y).

5. Consider a floating point arithmetic system with base β = 2 and t = 3 digits in the sig-
nificand. Compute (21 × 0.100 − 20 × 0.111) .

6. Consider the representation of floating point numbers in IEEE 754 standard. Find
(i) The largest number in magnitude representable for single precision.
(ii) The largest number in magnitude representable for double precision.
(iii) The smallest number in magnitude representable for single precision.
(iv) The smallest number in magnitude representable for double precision.

7. Given a system of linear equations


( )( ) ( )
7 10 x 1
= .
5 7 y 0.7
Find the exact solution for the given system. If x̂ = −0.17 and ŷ = 0.22 is the computed solution
of above system. Verify that the computed solution is the exact solution for the system
( )( ) ( )
7 10 x̂ 1.01
= .
5 7 ŷ 0.69
2


n
8. Suppose we compute the sum wj using floating point arithmetic with unit roundoff u. Then
j=1
 

n ∑
n
fl  wj  = wj (1 + γj ),
j=1 j=1

where |γj | ≤ (n − 1)u + O(u2 ), regardless of the order in which the terms are accumulated.

You might also like