1 Chapter 1 Introductory Concepts and Calculus Review.

Slides:



Advertisements
Similar presentations
Chapter 0 Review of Algebra.
Advertisements

Roundoff and truncation errors
2009 Spring Errors & Source of Errors SpringBIL108E Errors in Computing Several causes for malfunction in computer systems. –Hardware fails –Critical.
Calculus I – Math 104 The end is near!. Series approximations for functions, integrals etc.. We've been associating series with functions and using them.
Numerical Analysis 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Topics covered: Floating point arithmetic CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Round-Off and Truncation Errors
Chapter 1 Introduction The solutions of engineering problems can be obtained using analytical methods or numerical methods. Analytical differentiation.
Copyright 2008 Koren ECE666/Koren Part.9b.1 Israel Koren Spring 2008 UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 3 Approximations and Errors.
Part 3 Truncation Errors.
M68K Assembly Language Programming Bob Britton Chapter 12 IEEE Floating Point Notice: Chapter slides in this series originally provided by B.Britton. This.
1 Error Analysis Part 1 The Basics. 2 Key Concepts Analytical vs. numerical Methods Representation of floating-point numbers Concept of significant digits.
Computer Science A 14: 3/4. Computing with numbers - Precision - Representation - Computing with numbers - Example.
Ch. 21. Square-rootingSlide 1 VI Function Evaluation Topics in This Part Chapter 21 Square-Rooting Methods Chapter 22 The CORDIC Algorithms Chapter 23.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
2.1 2 Number Systems Foundations of Computer Science  Cengage Learning.
Fractional Exponents and Radicals
Properties of Logarithms
Copyright © Cengage Learning. All rights reserved. 0 Precalculus Review.
Numerical Computations in Linear Algebra. Mathematically posed problems that are to be solved, or whose solution is to be confirmed on a digital computer.
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
© 2010 Pearson Education Inc.Goldstein/Schneider/Lay/Asmar, CALCULUS AND ITS APPLICATIONS, 12e– Slide 1 of 57 Chapter 11 Taylor Polynomials and Infinite.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Computer Science 111 Fundamentals of Programming I Number Systems.
Lecture 2 Number Representation and accuracy
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.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Data Representation in Computer Systems
ME 142 Engineering Computation I Computer Precision & Round-Off Error.
Chapter 8-Infinite Series Calculus, 2ed, by Blank & Krantz, Copyright 2011 by John Wiley & Sons, Inc, All Rights Reserved.
Round-off Errors.
Round-off Errors and Computer Arithmetic. The arithmetic performed by a calculator or computer is different from the arithmetic in algebra and calculus.
CSC 221 Computer Organization and Assembly Language
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter.
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.
Introduction to computing
1 Approximation. 2 Taylor Series 3 Truncation Error  In general, the nth order Taylor series expansion will be exact for an nth order polynomial  In.
Numerical Analysis CC413 Propagation of Errors.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
Slide Copyright © 2009 Pearson Education, Inc. Slide Copyright © 2009 Pearson Education, Inc. Chapter 1 Number Theory and the Real Number System.
Sources of Computational Errors FLP approximates exact computation with real numbers Two sources of errors to understand and counteract: 1. Representation.
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.
NUMERICAL ANALYSIS I. Introduction Numerical analysis is concerned with the process by which mathematical problems are solved by the operations.
Floating Point Representations
Fundamentals of Computer Science
Dr. Clincy Professor of CS
ME 142 Engineering Computation I
Number Systems Lab session 1 Xuan Guo.
Outline Introduction Floating Point Arithmetic Adder Multiplier.
Taylor series in numerical computations (review)
Chapter 2 ERROR ANALYSIS
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Errors in Numerical Methods
Errors in Numerical Methods
Dr. Clincy Professor of CS
Section 11.6 – Taylor’s Formula with Remainder
Numerical Analysis Lecture 2.
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Chapter 1 / Error in Numerical Method
Chapter 2 A Survey of Simple Methods and Tools
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

1 Chapter 1 Introductory Concepts and Calculus Review

2 Introduction The subjects The subjects The derivation of the algorithms The derivation of the algorithms The implementation of the algorithms The implementation of the algorithms Analyze the algorithms mathematically Analyze the algorithms mathematically Accuracy, efficiency, and stability Accuracy, efficiency, and stability

3 1.1 Basic Tools of Calculus Taylor ’ s Theorem Integral mean value theorem

4 Three particular expansions of Taylor ’ s Theorem where x 0 = ?

5 Three particular expansions of Taylor ’ s Theorem where x 0 = 0

6 Example : e x Finally, n can be found! (here n = 9 ) If we want then Let x 0 = 0

7 Example : e x p 2 (x) p 9 (x) exp(x)

8 Example : e x

9 The result tells us The result tells us We can approximate the exponential function to within accuracy using a specific polynomial, and this accuracy holds for all x in a specified interval. We can approximate the exponential function to within accuracy using a specific polynomial, and this accuracy holds for all x in a specified interval.

10 Example 1.1 Let f (x) = (x+1) 1/2, then the second-order Taylor polynomial (computed about x 0 = 0 ) is computed as follows: Let f (x) = (x+1) 1/2, then the second-order Taylor polynomial (computed about x 0 = 0 ) is computed as follows: 2

11 Example 1.2: sin Function: Function: Accuracy: Accuracy:

12 Example 1.3: arctan Function: Function:

13 Example 1.3: arctan Function: Function: Error term Let and

14 Example 1.3 : arctan Please determine the error in a ninth-degree Taylor approximation to the arctangent function. Please determine the error in a ninth-degree Taylor approximation to the arctangent function. Since 2n +1 = 9 implies that n = 4, we have Since 2n +1 = 9 implies that n = 4, we have

15 Taylor ’ s Theorem Expansion Let x  x + h and x 0  x

Mean Value and Extreme Value Theorems

Mean Value and Extreme Value Theorems W

Mean Value and Extreme Value Theorems Mm Critical point

Mean Value and Extreme Value Theorems The integral mean value theorem (a corollary of the intermediate value theorem) states that a function continuous on an interval takes on its average value somewhere in the interval. More exactly, if is continuous on, then there exists in such that.

Mean Value and Extreme Value Theorems

Error, Approximate Equality, and Asymptotic Order Notation Error A : a quantity( 數量 ) we want to compute A : a quantity( 數量 ) we want to compute A h : an approximation( 近似值 ) to that quantity A h : an approximation( 近似值 ) to that quantity Relative error ( 相對誤差 ) is better. Relative error ( 相對誤差 ) is better. These errors are both computational errors. These errors are both computational errors.

Notation: Approximate Equality Approximate equality Approximate equality It is an equivalence relation, and satisfy the following properties: It is an equivalence relation, and satisfy the following properties: Transitive( 遞移性 ): Transitive( 遞移性 ): Symmetric( 對稱性 ): Symmetric( 對稱性 ): Reflexive( 反身性 ): Reflexive( 反身性 ):

Notation: Asymptotic Order (Big O)

24 Example 1.4 Let Let Simple calculus shows that Simple calculus shows that so that we have so that we have Here Here

Notation: Asymptotic Order (Big O)

26 Example 1.6

27

A Primer on Computer Arithmetic Computer arithmetic is generally inexact. Computer arithmetic is generally inexact. While the errors are very small, they can accumulate and dominate the calculation. While the errors are very small, they can accumulate and dominate the calculation. Example: floating-point arithmetic Example: floating-point arithmetic Reference: An Introduction to Computer Science, Chapter 3, Excess System (Excess_127 or Excess_1023) Reference: An Introduction to Computer Science, Chapter 3, Excess System (Excess_127 or Excess_1023) is the sign of the number, f is the fraction ( 0 <= f <= 1 ), is the base of the internal number system

IEEE standards for floating-point representation (底數 尾數)

Example Show the representation of the normalized number x Solution The sign is positive. The Excess_127 representation of the exponent is 133. You add extra 0s on the right to make it 23 bits. The number in memory is stored as:

31 Errors Rounding error v.s. chopping error Rounding error v.s. chopping error Rounding: 四捨五入 Rounding: 四捨五入 Chopping: 無條件捨去 Chopping: 無條件捨去 Discussion: Discussion: Rounding is more accurate but chopping is faster. Rounding is more accurate but chopping is faster. The chopping error is indeed lager than the rounding error. The chopping error is indeed lager than the rounding error.

32 Example Rounding error Rounding error Chopping error Chopping error

33 Subtractive Cancellation If a and b are accurate to 16 decimal digits. What about their difference c = a - b ? If a and b are accurate to 16 decimal digits. What about their difference c = a - b ? Example: Example: The result c is accurate to 12 digits. The result c is accurate to 12 digits. This is because we were subtracting two nearly equal numbers. This is because we were subtracting two nearly equal numbers.

34 Example Function : Function : We know that : We know that : Taylor ’ s Theorem : Taylor ’ s Theorem :

35 ……

Simple Approximations Error function: Error function: (probability theory) (probability theory) It is not possible to evaluate this integral by means of the fundamental theorem of calculus. It is not possible to evaluate this integral by means of the fundamental theorem of calculus. Use Taylor ’ s Theorem to approximate. Use Taylor ’ s Theorem to approximate. where where

37 Substitution:Define So that we have Set where c depends on t and

38 Apply the Integral Mean Value Theorem: The structured form: where

39 Use the big O notation: Use the big O notation: Use the approximate equality notation: Use the approximate equality notation: Simplify: if the values of x between 0 and 2 Simplify: if the values of x between 0 and 2 if k >=1 if k >=1 thus thus

40 Fundamental Idea When confronted with a computation that cannot be done exactly, we often replace that relevant function with something simpler that approximates it, and carry out the computation exactly on the simple approximation. When confronted with a computation that cannot be done exactly, we often replace that relevant function with something simpler that approximates it, and carry out the computation exactly on the simple approximation.