Introduction to error analysis Class II "The purpose of computing is insight, not numbers", R. H. Hamming.

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

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)
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
Chapter 8 Representing Information Digitally.
Faculty of Computer Science © 2006 CMPUT 229 Floating Point Representation Operating with Real Numbers.
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Round-Off and Truncation Errors
Lecture 2: Numerical Differentiation. Derivative as a gradient
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.
Computer Science 210 Computer Organization Floating Point Representation.
ES 84 Numerical Methods for Engineers, Mindanao State University- Iligan Institute of Technology Prof. Gevelyn B. Itao.
IEEE Floating Point Numbers Overview Noah Mendelsohn Tufts University Web: COMP.
February 26, 2003MIPS floating-point arithmetic1 Question  Which of the following are represented by the hexadecimal number 0x ? —the integer.
Numerical Computations in Linear Algebra. Mathematically posed problems that are to be solved, or whose solution is to be confirmed on a digital computer.
Chapter 1 Scientific Computing Approximation in Scientific Computing (1.2) January 12, 2010.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Error: Finding Creative ways to Screw Up CS 170: Computing for the Sciences and Mathematics.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 22, 2004 Lecture Number: 24.
Summer 2007CISC121 - Prof. McLeod1 CISC121 – Lecture 12 Last time: –Efficient recursive and non-recursive sorts. –Analyzing the complexity of recursive.
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.
MATH 685/CSI 700 Lecture Notes Lecture 1. Intro to Scientific Computing.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
Introduction to Numerical Analysis I
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted.
ME 142 Engineering Computation I Computer Precision & Round-Off Error.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 20, 2004 Lecture Number: 23.
Calculating Two’s Complement. The two's complement of a binary number is defined as the value obtained by subtracting the number from a large power of.
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.
16. Binary Numbers Programming in C++ Computer Science Dept Va Tech August, 1999 © Barnette ND, McQuain WD, Keenan MA 1 Binary Number System Base.
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
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 3.
Lecture 4 - Numerical Errors CVEN 302 June 10, 2002.
Numerical Analysis CC413 Propagation of Errors.
Errors in Numerical Methods
14/02/ Floating Point Representation Major: All Engineering Majors Authors: Autar Kaw, Charlie Barker Presented.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4.
Spring 2006CISC101 - Prof. McLeod1 Announcements Assn 4 is posted. Note that due date is the 12 th (Monday) at 7pm. (Last assignment!) Final Exam on June.
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.
Number Systems Decimal Can you write 12,045 in expanded form? Base? Allowable digits for each place?
Chapter 2 Errors in Numerical Methods and Their Impacts.
NUMERICAL ANALYSIS I. Introduction Numerical analysis is concerned with the process by which mathematical problems are solved by the operations.
Introduction to Numerical Analysis I
Nat 4/5 Computing Science Lesson 1: Binary
Machine arithmetic and associated errors Introduction to error analysis Class II.
Machine arithmetic and associated errors Introduction to error analysis (cont.) Class III.
Taylor series in numerical computations (review)
Recall our hypothetical computer Marc-32
Roundoff and Truncation Errors
CSCI206 - Computer Organization & Programming
Floating Point Representation
Approximations and Round-Off Errors Chapter 3
Topic 1: Data Representation
COMS 161 Introduction to Computing
Chapter 1 / Error in Numerical Method
Roundoff and Truncation Errors
Errors and Error Analysis Lecture 2
Presentation transcript:

Introduction to error analysis Class II "The purpose of computing is insight, not numbers", R. H. Hamming

Last time: We discussed what the course is and is not The place of computational science among other sciences Class web site, computer setup, etc.

Also last time: The course will introduce you to supercomputer on the desk:

Today’s class. Background Taylor Series: the workhorse of numerical methods. F(x + h) =~ F(x) + h*F’(x) Sin(x) =~ x - 1/3!(x^3), works very well for x << 1, OK for x < 1.

What is the common cause of these disasters/mishaps? Patriot Missile Failure, 1st Gulf war. 28 dead. Wrong parliament make-up, Germany 1992.

Numerical math != Math

Errors. 1.Absolute error. 2.Relative error (usually more important): |X_exact - X_approx|/|X_exact| *100% Example. Suppose the exact number is x = 0.001, but we only have its approximation, x= Then the relative error = ( )/0.001*100% = 100%. (Even though the absolute error is only 0.001!)

Let’s compute the derivative: F(x) = exp(x). Use the definition. Where do the errors come from? A hands-on example. num_derivative.cc

Two types of error expected: 1.Trucncation error (from using the Taylor series) 2.Round-off error which leads to “loss of significance”.

Round-off error: Suppose X_exact = But say you can only keep two digits after the decimal point. Then X_approx = Relative error = (0.004/0.234)*100 = 1.7%. But why do we make that error? Is it inevitable?

The very basics of the floating point representation Decimal: (+/-)0.d 1 d 2 …. x10^n (d1 != 0). n = integer. Binary: (+/-)0.b 1 b 2 ….. x 2^m. b1 = 1, others 0 or 1. Example: 1/10 = ( …..) (infinite series). KEY: MOST REAL NUMBERS CAN NOT BE REPRESENTED EXACTLY

Machine real number line has holes. Example. Assume only 3 significant digits, that is Possible numbers are (+/-)(0.b 1 b 2 b 3 )x2^k, K= +1, 0, or -1. b= 0 or 1. Then the next smallest number above zero Is 1/16 = 0.001x2^-1. Largest = ?

Realistic machine: 32 bit Float-point number = (+/-)q x 2^m. (IEEE standard) Sign of q -> 1 bit Integer |m| 8 bit Number q 23 bits Largest number ~ 2^128 ~ 3*10^38 Smallest positive number ~ 10 ^-38 MACHINE EPSILON: smallest e such that 1 + e > 1. Very important!