Approximation and Round-Off Errors: Speed: 48.X Mileage: 87324.4X
Approximation and Round-Off Errors: Speed: 48.X Mileage: 87324.4X
Significant Figures
Number of significant figures 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 x 104 5.380 x 104 5.3800 x 104 3 4 5
Zeros are sometimes used to locate the decimal point not significant figures. 0.00001753 0.0001753 0.001753 4 4 4
How confident we are in our approximate result? The question is how much error is present in our calculation and is it tolerable?
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.
Fig 3.2
Error Definitions
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
Use absolute value. Computations are repeated until stopping criterion is satisfied.
a s
10
1000 0000 0000 0001 = (-1) 2s complement 0000 0000 0000 0001 = 1 0000 0000 0000 0000 = 0 1111 1111 1111 1111 = -1 1111 1111 1111 1110 = -2 Number range ?, How to compute a from a ?
11
fraction
Floating point number (base-10) 156.78 0.15678x103 in a floating point base-10 system
12
Normalized to remove the leading zeroes. Multiply the mantissa by 10 and lower the exponent by 1 0.2941 x 10-1
Additional significant Chapter 3 figure is retained
13
Fig 3.5
Floating point number Numbers such as , e, or 7 cannot be expressed by a fixed number of significant figures. Computers use a base-2 representation, they cannot precisely represent certain exact base-10 numbers. Fractional quantities are typically represented in computer using floating point form, e.g.,
14
m be
mantissa
15
Floating point representation allows both fractions and very large numbers. However,
Floating point numbers take up more room. Take longer to process than integer numbers. not anymore Round-off errors are introduced because mantissa holds only a finite number of significant figures.
Chopping, Rounding Example: =3.14159265358 to be stored on a base-10 system carrying 7 significant digits. =3.141592 chopping error t=0.00000065 If rounded =3.141593 t=0.00000035 Some machines use chopping, because rounding adds to the computational overhead. Since number of significant figures is large enough, resulting chopping error is negligible.
16
17
18
19
Fig 3.7
20
21
Arithmetic Manipulations
22
Common Arithmetic operations The mantissa of the number with the smaller exponent is modified so that the exponents are the same 0.1557 101 + 0.4381 10-1
0.1557 10 0.438110
1 1
0.1557
Arithmetic Manipulations
Subtraction 0.3641 102 - 0.2686 102
23
0.364110
2 2
2 0.3641 10
0.2686 10
0.9550 10
Arithmetic Manipulations
24
0.7642 10
3 3
3 0.7642 10
0.7642 10
0.7641103 3 0.000110
0.1000 10
Arithmetic Manipulations
25
0.8754 10
Errors
26
0.4000
10
4 4
0.4000
10
+ 0.000000110
+ 0.0000001104 4 0.400000110
0.4000 10
Errors
27
b b 2 4ac x= 2a
0.12345678 0.12345??? 0.12345666 0.12345??? 0.00000012 0.00000???
%b b 4ac = b
2