Download presentation
Presentation is loading. Please wait.
Published byJoseph Neal Modified over 8 years ago
1
Module 2.2 Errors 03/08/2011
2
Sources of errors Data errors Modeling Implementation errors Absolute and relative errors Round off errors Overflow and underflow Arithmatic errors Error propagation Truncation errors
3
Precision:the number of significant digits Floating point number : a decimal expansion Flops: FLoating point Operations Per Second, a measure of a computer's performance, especially in fields of scientific calculations that make heavy use of floating point calculationscomputerperformancefloating point calculations Exponential notation: a floating point number as a decimal fraction times a power of 10 (a*10^n, 698.043990 10 3 ) a – significand, fractional part, mantissa, n- exponent A normalized number in exp notation has the decimal point immediately preceding the first nonzero digit. The significant digits of a floating point number are all the digits except the leading zeros The significant digits of an integer are all the digits except the leading and trailing zeros
4
Exponential notation Example: 698.043990 10 3 Fractional part or significand? 698043990 Exponent? 3 Normalized? 0.698043990 10 5
5
Significant digits Significant digits of floating point number All digits except leading zeros Number of significant digits in 698.043990 10 3 ? 9 significant digits Precision Number of significant digits
6
Magnitude Power of 10 when number expressed in normalized exponential notation Magnitude of 698.043990 10 3 ? Magnitude of 0.698043990 10 5 ? 10 5
7
Absolute error |correct – result| Example: correct = 0.698043990 10 5 and result = 0.698043 10 5 Absolute error = ? |0.698043990 10 5 - 0.698043 10 5 | = 0.00000990 10 5 = 0.990
8
Relative error |(correct - result) / correct| Example: (correct - result) = 0.990 and correct = 0.698043990 10 5 0.990/(0.698043990 10 5 ) = 1.4182487 10 -5
9
Round-off error Problem of not having enough bits to store entire floating point number(round up, round down) and approximating the result to the nearest number that can be represented Example: 0.698043990 10 5 if only can store 6 significant digits, rounded? 0.698044 10 5 Do not test directly for equality of floating point variables
10
Overflow/underflow Overflow - error condition that occurs when not enough bits to express value in computer Underflow - error condition that occurs when result of computation is too small for computer to represent
11
Arithematic errors;Algebra rules do not necessarily hold x = 355/113, y = 101/112, z = 52/113 All different ways of calculating x - 3y - z should be 0, but is not
12
Addition and subtraction errors If big difference in magnitude of numbers Example: (0.65 10 5 ) + (0.98 10 -5 ) = ? 65000 + 0.0000098 = 65000.0000098 Suppose can store 6 significant digits rounded? 65000.0 = (0.650000 10 5 )
13
Associative property Does not necessarily hold Sum of many small numbers + large number may not equal adding each small number to large number Similarly, distributive property does not necessarily hold
14
Cancellation error Problem of subtracting numbers that are almost equal Answer can have fewer significant digits than original numbers
15
To reduce numerical errors Round-off errors Use maximum number of significant digits If big difference in magnitude of numbers Add from smallest to largest numbers
16
Propagated (accumulation ) round-off errors Example: repeatedly executing t = t + dt Better to repeatedly increment i and calculate t = i * dt
17
Truncation error Error that occurs when truncated, or finite, sum is used as approximation for sum of infinite series
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.