Overview CNS 3320 – Numerical Software Engineering.

Slides:



Advertisements
Similar presentations
Chapter 24 Numerics Bjarne Stroustrup
Advertisements

Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
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)
CS 351/ IT 351 Modeling and Simulation Technologies Errors In Models Dr. Jim Holten.
Asymptotic error expansion Example 1: Numerical differentiation –Truncation error via Taylor expansion.
Numerical Computation
Introduction to Scientific Computing ICE / ICE 508 Prof. Hyuckjae Lee KAIST- ICC
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Approximations and Errors
COS 323: Computing for the Physical and Social Sciences Szymon Rusinkiewicz.
Lecture 2: Numerical Differentiation. Derivative as a gradient
COS 323: Computing for the Physical and Social Sciences Szymon Rusinkiewicz.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 3 Approximations and Errors.
High Precision Calculation of the Digamma Function Mohammad I Rafiq School of Computer Science, Carnegie Mellon University Research Advisor : Dr. Victor.
1cs542g-term CS542G - Breadth in Scientific Computing.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 5 Approximations, Errors and The Taylor Series.
NUMERICAL ERROR ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
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
Introduction and Analysis of Error Pertemuan 1
Today’s class Numerical Integration Newton-Cotes Numerical Methods
Error: Finding Creative ways to Screw Up CS 170: Computing for the Sciences and Mathematics.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 22, 2004 Lecture Number: 24.
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:
EE 3561_Unit_1(c)Al-Dhaifallah EE 3561 : - Computational Methods in Electrical Engineering Unit 1: Introduction to Computational Methods and Taylor.
College of Engineering Representing Numbers in a Computer Section B, Spring 2003 COE1361: Computing for Engineers COE1361: Computing for Engineers 1 COE1361:
ME 142 Engineering Computation I Computer Precision & Round-Off Error.
5.2 Errrors. Why Study Errors First? Nearly all our modeling is done on digital computers (aside: what would a non-digital analog computer look like?)
Introduction to error analysis Class II "The purpose of computing is insight, not numbers", R. H. Hamming.
Villanova University Dept. of Civil & Environmental Engineering CEE 3704 Statistical and Numerical Analysis 1 CEE 3704 Statistical and Numerical Analysis.
1. Understanding the Problem 2. Brainstorming 3. Drawing an I/O (Input/Output) diagram 4. 5-step Process (or: Small iPods Make Copying Tough) Developing.
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
Derivatives In modern structural analysis we calculate response using fairly complex equations. We often need to solve many thousands of simultaneous equations.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Introduction Course Outline.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 3.
Numerical Analysis Intro to Scientific Computing.
Lecture 4 - Numerical Errors CVEN 302 June 10, 2002.
Numerical Analysis CC413 Propagation of Errors.
Numerical Analysis. Numerical Analysis or Scientific Computing Concerned with design and analysis of algorithms for solving mathematical problems that.
Errors in Numerical Methods
Numerical Analysis Intro to Scientific Computing.
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.
1 M 277 (60 h) Mathematics for Computer Sciences Bibliography  Discrete Mathematics and its applications, Kenneth H. Rosen  Numerical Analysis, Richard.
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.
S5.40. Module Structure 30% practical tests / 70% written exam 3h lectures / week (except reading week) 3 x 2h of computer labs (solving problems practicing.
Machine arithmetic and associated errors Introduction to error analysis Class II.
ME 142 Engineering Computation I
Taylor series in numerical computations (review)
Chapter 2 ERROR ANALYSIS
Errors in Numerical Methods
Class Notes 18: Numerical Methods (1/2)
Roundoff and Truncation Errors
Errors in Numerical Methods
More elements of Python programs
Numerical Analysis Lecture 2.
Sources of Error Major: All Engineering Majors
Chapter 1 / Error in Numerical Method
Roundoff and Truncation Errors
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

Overview CNS 3320 – Numerical Software Engineering

Numerical Computing What computers were invented for! –Scientific research, engineering, real-time control systems –NASA, satellites, electronic devices, ATMs Today’s programmers don’t know what their predecessors did –Most do “business data processing”, web apps –But even there numbers are important –The Patriot Missile failure was a needless floating-point error committed by careless programmers Getting accuracy from a machine takes some work Example: roundoff1.cpp, roundoff2.cpp, lostint.cpp

When Good Formulas Go Bad How do you solve a quadratic equation? How much accuracy do you need? Example: x 2 – x + 1 = 0 –quad1a.cpp (float, naive) –quad1b.cpp (double, naive) –quad2a.cpp (float, smart) –quad2b.cpp (double, smart) –Correct answers to 11 digits are: ,

When Good Formulas Go Bad How do you compute e x ? Transcendental numbers can only be approximated by finite processes We’ll use the MacLaurin Series –Taylor’s series expanded about 0 (see below) Examples: –exp1.cpp (98 terms for float, 126 for double) –exp2.cpp (uses reciprocal to avoid smearing)

Lesson to be Learned You can’t just code formulas and expect them to work Floating-point operations are like moving piles of sand: –Every time you move one you lose a little –You lose precision, that is (significant digits) We will learn how to recognize and minimize numeric error –By understanding floating-point number systems –By using intelligent algorithms and techniques

What About Arbitrary Precision Packages? Store numbers as strings of digits –And use easy, grade school algorithms –Java’s BigDecimal, Python’s long, decNumber –See roundoff3.c, Roundoff3.java They have their place –But they’re SLOW (compared to hardware, anyway) –Inappropriate for real-time control or for large, complex problems Hardware is the best answer for most apps –Fast, high-precision floating-point hardware

About This Course Overlaps with a traditional Numerical Methods course –We’ll find roots of equations, solve linear systems, calculate integrals, etc. But will have a CS emphasis –You’ll know what’s going on machine-wise –You’ll become familiar with the pertinent IEEE floating-point standards –You’ll gain some expertise in implementing precise mathematical libraries (someone has to do it!) See (Dinkumware site, actual header)

Types of Error Rounding error –Also called “roundoff” error –A fixed-size floating-point number system can only represent a finite collection of numbers x + y might not be in the set An input value x might not even be in the set to begin with Truncation Error –Similar in spirit to roundoff, but results from our stopping an infinite process Like the Taylor’s series example We have to stop sometime! We stop when we’re satisfied with the degree of accuracy Sometimes we must balance roundoff and truncation error –Decreasing one can increase the other