Lecture 2 Number Representation and accuracy

Slides:



Advertisements
Similar presentations
Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Advertisements

3- 1 Chapter 3 Introduction to Numerical Methods Second-order polynomial equation: analytical solution (closed-form solution): For many types of problems,
Roundoff and truncation errors
2009 Spring Errors & Source of Errors SpringBIL108E Errors in Computing Several causes for malfunction in computer systems. –Hardware fails –Critical.
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Error Measurement and Iterative Methods
Floating Point Numbers
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Approximations and Errors
Round-Off and Truncation Errors
1 CSE1301 Computer Programming Lecture 30: Real Number Representation.
Lecture 2: Numerical Differentiation. Derivative as a gradient
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 3 Approximations and Errors.
NUMERICAL ERROR ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
1 Error Analysis Part 1 The Basics. 2 Key Concepts Analytical vs. numerical Methods Representation of floating-point numbers Concept of significant digits.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 31.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
CHEMISTRY ANALYTICAL CHEMISTRY Fall Lecture 4.
Taylor Series & Error. Series and Iterative methods Any series ∑ x n can be turned into an iterative method by considering the sequence of partial sums.
Chapter 1 Infinite Series, Power Series
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
EE 3561_Unit_1(c)Al-Dhaifallah EE 3561 : - Computational Methods in Electrical Engineering Unit 1: Introduction to Computational Methods and Taylor.
Introduction to Numerical Analysis I
ES 240: Scientific and Engineering Computation. Chapter 4 Chapter 4: Errors Uchechukwu Ofoegbu Temple University.
ME 142 Engineering Computation I Computer Precision & Round-Off Error.
Round-off Errors.
Introduction to error analysis Class II "The purpose of computing is insight, not numbers", R. H. Hamming.
Round-off Errors and Computer Arithmetic. The arithmetic performed by a calculator or computer is different from the arithmetic in algebra and calculus.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter.
NUMERICAL ERROR Student Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
MECN 3500 Inter - Bayamon Lecture 3 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 3.
Numerical Analysis Intro to Scientific Computing.
ALTERNATING SERIES series with positive terms series with some positive and some negative terms alternating series n-th term of the series are positive.
Introduction to computing
Numerical Analysis CC413 Propagation of Errors.
CS1Q Computer Systems Lecture 2 Simon Gay. Lecture 2CS1Q Computer Systems - Simon Gay2 Binary Numbers We’ll look at some details of the representation.
Errors in Numerical Methods
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4.
ESO 208A/ESO 218 LECTURE 2 JULY 31, ERRORS MODELING OUTPUTS QUANTIFICATION TRUE VALUE APPROXIMATE VALUE.
Numerical Analysis CC413 Propagation of Errors. 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate.
Introduction to error analysis Class II "The purpose of computing is insight, not numbers", R. H. Hamming.
Module 2.2 Errors 03/08/2011. Sources of errors Data errors Modeling Implementation errors Absolute and relative errors Round off errors Overflow and.
Cosc 2150: Computer Organization Chapter 9, Part 3 Floating point numbers.
Chapter 2 Errors in Numerical Methods and Their Impacts.
Introduction to Numerical Analysis I
Machine arithmetic and associated errors Introduction to error analysis Class II.
ME 142 Engineering Computation I
Integer Division.
New head garb has been ordered
Topics IEEE Floating Point Standard Rounding Floating Point Operations
Machine arithmetic and associated errors Introduction to error analysis (cont.) Class III.
Copyright © Cengage Learning. All rights reserved.
Taylor series in numerical computations (review)
Topic 3d Representation of Real Numbers
Chapter 2 ERROR ANALYSIS
Recall our hypothetical computer Marc-32
Errors in Numerical Methods
Roundoff and Truncation Errors
CSCI206 - Computer Organization & Programming
Floating Point Representation
Errors in Numerical Methods
Approximations and Round-Off Errors Chapter 3
Numerical Analysis Lecture 2.
Chapter 1 / Error in Numerical Method
Roundoff and Truncation Errors
Errors and Error Analysis Lecture 2
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

Lecture 2 Number Representation and accuracy Normalized Floating Point Representation Significant Digits Accuracy and Precision Rounding and Chopping Reading assignment: Chapter 2 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Representing Real Numbers You are familiar with the decimal system Decimal System Base =10 , Digits(0,1,…9) Standard Representations EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Normalized Floating Point Representation No integral part, Advantage Efficient in representing very small or very large numbers EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Binary System Binary System Base=2, Digits{0,1} EE 3561_Unit_1 (c)Al-Dhaifallah 1435

7-Bit Representation (sign: 1 bit, Mantissa 3bits,exponent 3 bits) EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Fact Number that have finite expansion in one numbering system may have an infinite expansion in another numbering system You can never represent 0.1 exactly in any computer EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Representation Hypothetical Machine (real computers use ≥ 23 bit mantissa) Example: If a machine has 5 bits representation distributed as follows Mantissa 2 bits exponent 2 bit sign 1 bit Possible machine numbers (0.25=00001) (0.375= 01111) (1.5=00111) EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Representation Gap near zero EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Remarks Numbers that can be exactly represented are called machine numbers Difference between machine numbers is not uniform. So, sum of machine numbers is not necessarily a machine number 0.25 + .375 =0.625 (not a machine number) EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Significant Digits Significant digits are those digits that can be used with confidence. 0 1 2 3 4 Length of green rectangle = 3.45 significant EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Loss of Significance Mathematical operations may lead to reducing the number of significant digits 0.123466 E+02 6 significant digits ─ 0.123445 E+02 6 significant digits ────────────── 0.000021E+02 2 significant digits 0. 210000E-02 Subtracting nearly equal numbers causes loss of significance EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Accuracy and Precision Accuracy is related to closeness to the true value Precision is related to the closeness to other estimated values EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Accuracy and Precision Better Precision Accuracy is related to closeness to the true value Precision is related to the closeness to other estimated values Better accuracy EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Rounding and Chopping Rounding (1.2) Chopping (1.1) Rounding: Replace the number by the nearest machine number Chopping: Throw all extra digits True 1.1681 0 1 2 Rounding (1.2) Chopping (1.1) EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Error Definitions True Error can be computed if the true value is known EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Error Definitions Estimated error Used when the true value is not known EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Notation We say the estimate is correct to n decimal digits if We say the estimate is correct to n decimal digits rounded if EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Summary Number that have finite expansion in one numbering system may Number Representation Number that have finite expansion in one numbering system may have an infinite expansion in another numbering system. Normalized Floating Point Representation Efficient in representing very small or very large numbers Difference between machine numbers is not uniform Representation error depends on the number of bits used in the mantissa. EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Summary Rounding Chopping Error Definitions: Absolute true error True Percent relative error Estimated absolute error Estimated percent relative error EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Lecture 3 Taylor Theorem Motivation Taylor Theorem Examples Reading assignment: Chapter 4 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Motivation We can easily compute expressions like b a 0.6 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Series EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Series Example 1 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Series Example 1 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Series Example 2 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Convergence of Taylor Series (Observations, Example 1) The Taylor series converges fast (few terms are needed) when x is near the point of expansion. If |x-c| is large then more terms are needed to get good approximation. EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Series Example 3 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Example 3 remarks Can we apply Taylor series for x>1?? How many terms are needed to get good approximation??? These questions will be answered using Taylor Theorem EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Theorem (n+1) terms Truncated Taylor Series Reminder EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Theorem EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Error Term EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Example 4 (The Approximation Error) EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Example 5 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Example 5 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Example 5 Error term EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Alternative form of Taylor Theorem EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Theorem Alternative forms EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Derivative Mean-Value Theorem EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Alternating Series Theorem Alternating Series is special case of Taylor Series. This means that the error is less or equal to the magnitude of the first omitted term in the alternating series. EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Alternating Series Example 6 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Remark In this course all angles are assumed to be in radian unless you are told otherwise EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Maclurine series Find Maclurine Maclurine series expansion of cos (x) Maclurine series is a special case of Taylor series with the center of expansion c = 0 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Series Example 7 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Series Example 8 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Taylor Series Example 8 EE 3561_Unit_1 (c)Al-Dhaifallah 1435

Summary Taylor series expansion is very important in most numerical methods applications approximation remainder Remainder can be used to estimate approximation error or estimate the number of terms to achieve desirable accuracy EE 3561_Unit_1 (c)Al-Dhaifallah 1435