Numerics and Error Analysis

Size: px
Start display at page:

Download "Numerics and Error Analysis"

Transcription

1 Numerics and Error Analysis CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Numerics and Error Analysis 1 / 30

2 A Puzzle What is the value of the following expression? abs(3.*(4./3.-1.)-1.) CS 205A: Mathematical Methods Numerics and Error Analysis 2 / 30

3 A Puzzle What is the value of the following expression? abs(3.*(4./3.-1.)-1.) Machine precision ε m : smallest ε m with 1 + ε m = 1 CS 205A: Mathematical Methods Numerics and Error Analysis 2 / 30

4 Prototypical Example double x = 1.0; double y = x / 3.0; if (x == y*3.0) cout << "They are equal!"; else cout << "They are NOT equal."; CS 205A: Mathematical Methods Numerics and Error Analysis 3 / 30

5 Take-Away Mathematically correct Numerically sound CS 205A: Mathematical Methods Numerics and Error Analysis 4 / 30

6 Using Tolerances double x = 1.0; double y = x / 3.0; if (fabs(x-y*3.0) < numeric_limits<double>::epsilon) cout << "They are equal!"; else cout << "They are NOT equal."; CS 205A: Mathematical Methods Numerics and Error Analysis 5 / 30

7 Counting in Binary: Integer 463 = = CS 205A: Mathematical Methods Numerics and Error Analysis 6 / 30

8 Counting in Binary: Fractional = /4 = CS 205A: Mathematical Methods Numerics and Error Analysis 7 / 30

9 Familiar Problem 1 3 = Finite number of bits CS 205A: Mathematical Methods Numerics and Error Analysis 8 / 30

10 Fixed-Point Arithmetic l 2 l k+1 2 k Parameters: k, l Z k + l + 1 digits total Can reuse integer arithmetic (fast; GPU possibility): a + b = (a 2 k + b 2 k ) 2 k CS 205A: Mathematical Methods Numerics and Error Analysis 9 / 30

11 Two-Digit Example = = 0.02 Multiplication and division easily change order of magnitude! CS 205A: Mathematical Methods Numerics and Error Analysis 10 / 30

12 Demand of Scientific Applications Desired: Graceful transition CS 205A: Mathematical Methods Numerics and Error Analysis 11 / 30

13 Observations Compactness matters: = 602, 200, 000, 000, 000, 000, 000, 000 CS 205A: Mathematical Methods Numerics and Error Analysis 12 / 30

14 Observations Compactness matters: = 602, 200, 000, 000, 000, 000, 000, 000 Some operations are unlikely: CS 205A: Mathematical Methods Numerics and Error Analysis 12 / 30

15 Scientific Notation ± sign Store significant digits (d 0 + d 1 b 1 + d 2 b d p 1 b 1 p ) significand Base: b N Precision: p N Range of exponents: e [L, U] b e exponent CS 205A: Mathematical Methods Numerics and Error Analysis 13 / 30

16 Properties of Floating Point Unevenly spaced Machine precision ε m : smallest ε m with 1 + ε m = 1 CS 205A: Mathematical Methods Numerics and Error Analysis 14 / 30

17 Properties of Floating Point Unevenly spaced 1.75 Machine precision ε m : smallest ε m with 1 + ε m = 1 Needs rounding rule (e.g. round to nearest, ties to even ) CS 205A: Mathematical Methods Numerics and Error Analysis 14 / 30

18 Properties of Floating Point Unevenly spaced 1.75 Machine precision ε m : smallest ε m with 1 + ε m = 1 Needs rounding rule (e.g. round to nearest, ties to even ) Can remove leading 1 CS 205A: Mathematical Methods Numerics and Error Analysis 14 / 30

19 Infinite Precision Q = { a /b : a, b Z} Simple rules: a /b + c /d = (ad+cb) /bd Redundant: 1 /2 = 2 /4 Blowup: = Restricted operations: 2 2 CS 205A: Mathematical Methods Numerics and Error Analysis 15 / 30

20 Bracketing Store range a ± ε Special case of Interval Arithmetic Keeps track of certainty and rounding decisions Easy bounds: (x±ε 1 )+(y ±ε 2 ) = (x+y)±(ε 1 +ε 2 +error(x+y)) Implementation via operator overloading CS 205A: Mathematical Methods Numerics and Error Analysis 16 / 30

21 Sources of Error Rounding Discretization Modeling Input CS 205A: Mathematical Methods Numerics and Error Analysis 17 / 30

22 Example What sources of error might affect a financial simulation? CS 205A: Mathematical Methods Numerics and Error Analysis 18 / 30

23 Example Catastrophic cancellation Consider the function near x = 0. f(x) = ex 1 x 1 CS 205A: Mathematical Methods Numerics and Error Analysis 19 / 30

24 Absolute vs. Relative Error Absolute Error The difference between the approximate value and the underlying true value CS 205A: Mathematical Methods Numerics and Error Analysis 20 / 30

25 Absolute vs. Relative Error Absolute Error The difference between the approximate value and the underlying true value Relative Error Absolute error divided by the true value CS 205A: Mathematical Methods Numerics and Error Analysis 20 / 30

26 Absolute vs. Relative Error Absolute Error The difference between the approximate value and the underlying true value Relative Error Absolute error divided by the true value 2 in ± 0.02 in 2 in ± 1% CS 205A: Mathematical Methods Numerics and Error Analysis 20 / 30

27 Relative Error: Difficulty Problem: Generally not computable CS 205A: Mathematical Methods Numerics and Error Analysis 21 / 30

28 Relative Error: Difficulty Problem: Generally not computable Common fix: Be conservative CS 205A: Mathematical Methods Numerics and Error Analysis 21 / 30

29 Computable Measures of Success Root-finding problem For f : R R, find x such that f(x ) = 0. Actual output: x est with f(x est ) 1 CS 205A: Mathematical Methods Numerics and Error Analysis 22 / 30

30 Backward Error Backward Error The amount the problem statement would have to change to make the approximate solution exact CS 205A: Mathematical Methods Numerics and Error Analysis 23 / 30

31 Backward Error Backward Error The amount the problem statement would have to change to make the approximate solution exact Example 1: x CS 205A: Mathematical Methods Numerics and Error Analysis 23 / 30

32 Backward Error Backward Error The amount the problem statement would have to change to make the approximate solution exact Example 1: x Example 2: A x = b CS 205A: Mathematical Methods Numerics and Error Analysis 23 / 30

33 Conditioning Well-conditioned: Small backward error = small forward error Poorly conditioned: Otherwise Example: Root-finding CS 205A: Mathematical Methods Numerics and Error Analysis 24 / 30

34 Condition Number Condition number Ratio of forward to backward error CS 205A: Mathematical Methods Numerics and Error Analysis 25 / 30

35 Condition Number Condition number Ratio of forward to backward error Root-finding example: 1 f (x ) CS 205A: Mathematical Methods Numerics and Error Analysis 25 / 30

36 Theme Extremely careful implementation can be necessary. CS 205A: Mathematical Methods Numerics and Error Analysis 26 / 30

37 Example: x 2 double normsquared = 0; for (int i = 0; i < n; i++) normsquared += x[i]*x[i]; return sqrt(normsquared); CS 205A: Mathematical Methods Numerics and Error Analysis 27 / 30

38 Improved x 2 double maxelement = epsilon; for (int i = 0; i < n; i++) maxelement = max(maxelement, fabs(x[i])); for (int i = 0; i < n; i++) { double scaled = x[i] / maxelement; normsquared += scaled*scaled; } return sqrt(normsquared) * maxelement; CS 205A: Mathematical Methods Numerics and Error Analysis 28 / 30

39 More Involved Example: i x i double sum = 0; for (int i = 0; i < n; i++) sum += x[i]; CS 205A: Mathematical Methods Numerics and Error Analysis 29 / 30

40 Motivation for Kahan Algorithm ((a + b) a) b =? 0 Store compensation value! Details in textbook Next CS 205A: Mathematical Methods Numerics and Error Analysis 30 / 30

How do computers represent numbers?

How do computers represent numbers? How do computers represent numbers? Tips & Tricks Week 1 Topics in Scientific Computing QMUL Semester A 2017/18 1/10 What does digital mean? The term DIGITAL refers to any device that operates on discrete

More information

Notes for Chapter 1 of. Scientific Computing with Case Studies

Notes for Chapter 1 of. Scientific Computing with Case Studies Notes for Chapter 1 of Scientific Computing with Case Studies Dianne P. O Leary SIAM Press, 2008 Mathematical modeling Computer arithmetic Errors 1999-2008 Dianne P. O'Leary 1 Arithmetic and Error What

More information

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460

Arithmetic and Error. How does error arise? How does error arise? Notes for Part 1 of CMSC 460 Notes for Part 1 of CMSC 460 Dianne P. O Leary Preliminaries: Mathematical modeling Computer arithmetic Errors 1999-2006 Dianne P. O'Leary 1 Arithmetic and Error What we need to know about error: -- how

More information

1 Backward and Forward Error

1 Backward and Forward Error Math 515 Fall, 2008 Brief Notes on Conditioning, Stability and Finite Precision Arithmetic Most books on numerical analysis, numerical linear algebra, and matrix computations have a lot of material covering

More information

Lecture 7. Floating point arithmetic and stability

Lecture 7. Floating point arithmetic and stability Lecture 7 Floating point arithmetic and stability 2.5 Machine representation of numbers Scientific notation: 23 }{{} }{{} } 3.14159265 {{} }{{} 10 sign mantissa base exponent (significand) s m β e A floating

More information

Chapter 1: Introduction and mathematical preliminaries

Chapter 1: Introduction and mathematical preliminaries Chapter 1: Introduction and mathematical preliminaries Evy Kersalé September 26, 2011 Motivation Most of the mathematical problems you have encountered so far can be solved analytically. However, in real-life,

More information

Introduction CSE 541

Introduction CSE 541 Introduction CSE 541 1 Numerical methods Solving scientific/engineering problems using computers. Root finding, Chapter 3 Polynomial Interpolation, Chapter 4 Differentiation, Chapter 4 Integration, Chapters

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

Norms, Sensitivity and Conditioning

Norms, Sensitivity and Conditioning Norms, Sensitivity and Conditioning CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Norms, Sensitivity and Conditioning 1

More information

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science EAD 115 Numerical Solution of Engineering and Scientific Problems David M. Rocke Department of Applied Science Computer Representation of Numbers Counting numbers (unsigned integers) are the numbers 0,

More information

ECS 231 Computer Arithmetic 1 / 27

ECS 231 Computer Arithmetic 1 / 27 ECS 231 Computer Arithmetic 1 / 27 Outline 1 Floating-point numbers and representations 2 Floating-point arithmetic 3 Floating-point error analysis 4 Further reading 2 / 27 Outline 1 Floating-point numbers

More information

Linear Systems and LU

Linear Systems and LU Linear Systems and LU CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Linear Systems and LU 1 / 48 Homework 1. Homework 0:

More information

1 Floating point arithmetic

1 Floating point arithmetic Introduction to Floating Point Arithmetic Floating point arithmetic Floating point representation (scientific notation) of numbers, for example, takes the following form.346 0 sign fraction base exponent

More information

Chapter 1 Mathematical Preliminaries and Error Analysis

Chapter 1 Mathematical Preliminaries and Error Analysis Chapter 1 Mathematical Preliminaries and Error Analysis Per-Olof Persson persson@berkeley.edu Department of Mathematics University of California, Berkeley Math 128A Numerical Analysis Limits and Continuity

More information

Floating-point Computation

Floating-point Computation Chapter 2 Floating-point Computation 21 Positional Number System An integer N in a number system of base (or radix) β may be written as N = a n β n + a n 1 β n 1 + + a 1 β + a 0 = P n (β) where a i are

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Jim Lambers MAT 610 Summer Session Lecture 2 Notes

Jim Lambers MAT 610 Summer Session Lecture 2 Notes Jim Lambers MAT 610 Summer Session 2009-10 Lecture 2 Notes These notes correspond to Sections 2.2-2.4 in the text. Vector Norms Given vectors x and y of length one, which are simply scalars x and y, the

More information

ACM 106a: Lecture 1 Agenda

ACM 106a: Lecture 1 Agenda 1 ACM 106a: Lecture 1 Agenda Introduction to numerical linear algebra Common problems First examples Inexact computation What is this course about? 2 Typical numerical linear algebra problems Systems of

More information

Linear Systems and LU

Linear Systems and LU Linear Systems and LU CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Justin Solomon CS 205A: Mathematical Methods Linear Systems and LU 1 / 48 Homework 1. Homework 0 due Monday CS 205A:

More information

What Every Programmer Should Know About Floating-Point Arithmetic DRAFT. Last updated: November 3, Abstract

What Every Programmer Should Know About Floating-Point Arithmetic DRAFT. Last updated: November 3, Abstract What Every Programmer Should Know About Floating-Point Arithmetic Last updated: November 3, 2014 Abstract The article provides simple answers to the common recurring questions of novice programmers about

More information

Nonlinearity Root-finding Bisection Fixed Point Iteration Newton s Method Secant Method Conclusion. Nonlinear Systems

Nonlinearity Root-finding Bisection Fixed Point Iteration Newton s Method Secant Method Conclusion. Nonlinear Systems Nonlinear Systems CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Nonlinear Systems 1 / 27 Part III: Nonlinear Problems Not

More information

Notes on floating point number, numerical computations and pitfalls

Notes on floating point number, numerical computations and pitfalls Notes on floating point number, numerical computations and pitfalls November 6, 212 1 Floating point numbers An n-digit floating point number in base β has the form x = ±(.d 1 d 2 d n ) β β e where.d 1

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors 3-1 Roundoff errors and floating-point arithmetic

More information

Numerical Algorithms. IE 496 Lecture 20

Numerical Algorithms. IE 496 Lecture 20 Numerical Algorithms IE 496 Lecture 20 Reading for This Lecture Primary Miller and Boxer, Pages 124-128 Forsythe and Mohler, Sections 1 and 2 Numerical Algorithms Numerical Analysis So far, we have looked

More information

Binary floating point

Binary floating point Binary floating point Notes for 2017-02-03 Why do we study conditioning of problems? One reason is that we may have input data contaminated by noise, resulting in a bad solution even if the intermediate

More information

Mathematical preliminaries and error analysis

Mathematical preliminaries and error analysis Mathematical preliminaries and error analysis Tsung-Ming Huang Department of Mathematics National Taiwan Normal University, Taiwan September 12, 2015 Outline 1 Round-off errors and computer arithmetic

More information

CS412: Introduction to Numerical Methods

CS412: Introduction to Numerical Methods CS412: Introduction to Numerical Methods MIDTERM #1 2:30PM - 3:45PM, Tuesday, 03/10/2015 Instructions: This exam is a closed book and closed notes exam, i.e., you are not allowed to consult any textbook,

More information

Chapter 4 Number Representations

Chapter 4 Number Representations Chapter 4 Number Representations SKEE2263 Digital Systems Mun im/ismahani/izam {munim@utm.my,e-izam@utm.my,ismahani@fke.utm.my} February 9, 2016 Table of Contents 1 Fundamentals 2 Signed Numbers 3 Fixed-Point

More information

Can ANSYS Mechanical Handle My Required Modeling Precision?

Can ANSYS Mechanical Handle My Required Modeling Precision? Can ANSYS Mechanical Handle My Required Modeling Precision? 2/8/2017 www.telescope-optics.net Recently, PADT received the following inquiry from a scientist interested in using ANSYS for telescope application

More information

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013 Number Systems III MA1S1 Tristan McLoughlin December 4, 2013 http://en.wikipedia.org/wiki/binary numeral system http://accu.org/index.php/articles/1558 http://www.binaryconvert.com http://en.wikipedia.org/wiki/ascii

More information

Lecture 28 The Main Sources of Error

Lecture 28 The Main Sources of Error Lecture 28 The Main Sources of Error Truncation Error Truncation error is defined as the error caused directly by an approximation method For instance, all numerical integration methods are approximations

More information

Errors. Intensive Computation. Annalisa Massini 2017/2018

Errors. Intensive Computation. Annalisa Massini 2017/2018 Errors Intensive Computation Annalisa Massini 2017/2018 Intensive Computation - 2017/2018 2 References Scientific Computing: An Introductory Survey - Chapter 1 M.T. Heath http://heath.cs.illinois.edu/scicomp/notes/index.html

More information

Chapter 1 Error Analysis

Chapter 1 Error Analysis Chapter 1 Error Analysis Several sources of errors are important for numerical data processing: Experimental uncertainty: Input data from an experiment have a limited precision. Instead of the vector of

More information

Nonlinearity Root-finding Bisection Fixed Point Iteration Newton s Method Secant Method Conclusion. Nonlinear Systems

Nonlinearity Root-finding Bisection Fixed Point Iteration Newton s Method Secant Method Conclusion. Nonlinear Systems Nonlinear Systems CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Justin Solomon CS 205A: Mathematical Methods Nonlinear Systems 1 / 24 Part III: Nonlinear Problems Not all numerical problems

More information

Tu: 9/3/13 Math 471, Fall 2013, Section 001 Lecture 1

Tu: 9/3/13 Math 471, Fall 2013, Section 001 Lecture 1 Tu: 9/3/13 Math 71, Fall 2013, Section 001 Lecture 1 1 Course intro Notes : Take attendance. Instructor introduction. Handout : Course description. Note the exam days (and don t be absent). Bookmark the

More information

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic Computer Arithmetic MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Fall 2013 Machine Numbers When performing arithmetic on a computer (laptop, desktop, mainframe, cell phone,

More information

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b.

CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5. Ax = b. CME 302: NUMERICAL LINEAR ALGEBRA FALL 2005/06 LECTURE 5 GENE H GOLUB Suppose we want to solve We actually have an approximation ξ such that 1 Perturbation Theory Ax = b x = ξ + e The question is, how

More information

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS

FLOATING POINT ARITHMETHIC - ERROR ANALYSIS FLOATING POINT ARITHMETHIC - ERROR ANALYSIS Brief review of floating point arithmetic Model of floating point arithmetic Notation, backward and forward errors Roundoff errors and floating-point arithmetic

More information

4.2 Floating-Point Numbers

4.2 Floating-Point Numbers 101 Approximation 4.2 Floating-Point Numbers 4.2 Floating-Point Numbers The number 3.1416 in scientific notation is 0.31416 10 1 or (as computer output) -0.31416E01..31416 10 1 exponent sign mantissa base

More information

Introduction and mathematical preliminaries

Introduction and mathematical preliminaries Chapter Introduction and mathematical preliminaries Contents. Motivation..................................2 Finite-digit arithmetic.......................... 2.3 Errors in numerical calculations.....................

More information

Lecture Notes 7, Math/Comp 128, Math 250

Lecture Notes 7, Math/Comp 128, Math 250 Lecture Notes 7, Math/Comp 128, Math 250 Misha Kilmer Tufts University October 23, 2005 Floating Point Arithmetic We talked last time about how the computer represents floating point numbers. In a floating

More information

Math 411 Preliminaries

Math 411 Preliminaries Math 411 Preliminaries Provide a list of preliminary vocabulary and concepts Preliminary Basic Netwon s method, Taylor series expansion (for single and multiple variables), Eigenvalue, Eigenvector, Vector

More information

Lecture 12. Block Diagram

Lecture 12. Block Diagram Lecture 12 Goals Be able to encode using a linear block code Be able to decode a linear block code received over a binary symmetric channel or an additive white Gaussian channel XII-1 Block Diagram Data

More information

ROUNDOFF ERRORS; BACKWARD STABILITY

ROUNDOFF ERRORS; BACKWARD STABILITY SECTION.5 ROUNDOFF ERRORS; BACKWARD STABILITY ROUNDOFF ERROR -- error due to the finite representation (usually in floatingpoint form) of real (and complex) numers in digital computers. FLOATING-POINT

More information

An Introduction to Numerical Analysis

An Introduction to Numerical Analysis An Introduction to Numerical Analysis Department of Mathematical Sciences, NTNU 21st august 2012 Practical issues webpage: http://wiki.math.ntnu.no/tma4215/2012h/start Lecturer:, elenac@math.ntnu.no Lecures:

More information

Program 1 Foundations of Computational Math 1 Fall 2018

Program 1 Foundations of Computational Math 1 Fall 2018 Program 1 Foundations of Computational Math 1 Fall 2018 Due date: 11:59PM on Friday, 28 September 2018 Written Exercises Problem 1 Consider the summation σ = n ξ i using the following binary fan-in tree

More information

Binary Floating-Point Numbers

Binary Floating-Point Numbers Binary Floating-Point Numbers S exponent E significand M F=(-1) s M β E Significand M pure fraction [0, 1-ulp] or [1, 2) for β=2 Normalized form significand has no leading zeros maximum # of significant

More information

Numerical Methods in Physics and Astrophysics

Numerical Methods in Physics and Astrophysics Kostas Kokkotas 2 November 6, 2007 2 kostas.kokkotas@uni-tuebingen.de http://www.tat.physik.uni-tuebingen.de/kokkotas Kostas Kokkotas 3 Error Analysis Definition : Suppose that x is an approximation to

More information

Continuing discussion of CRC s, especially looking at two-bit errors

Continuing discussion of CRC s, especially looking at two-bit errors Continuing discussion of CRC s, especially looking at two-bit errors The definition of primitive binary polynomials Brute force checking for primitivity A theorem giving a better test for primitivity Fast

More information

Remainders. We learned how to multiply and divide in elementary

Remainders. We learned how to multiply and divide in elementary Remainders We learned how to multiply and divide in elementary school. As adults we perform division mostly by pressing the key on a calculator. This key supplies the quotient. In numerical analysis and

More information

Register machines L2 18

Register machines L2 18 Register machines L2 18 Algorithms, informally L2 19 No precise definition of algorithm at the time Hilbert posed the Entscheidungsproblem, just examples. Common features of the examples: finite description

More information

8/13/16. Data analysis and modeling: the tools of the trade. Ø Set of numbers. Ø Binary representation of numbers. Ø Floating points.

8/13/16. Data analysis and modeling: the tools of the trade. Ø Set of numbers. Ø Binary representation of numbers. Ø Floating points. Data analysis and modeling: the tools of the trade Patrice Koehl Department of Biological Sciences National University of Singapore http://www.cs.ucdavis.edu/~koehl/teaching/bl5229 koehl@cs.ucdavis.edu

More information

Introduction to Finite Di erence Methods

Introduction to Finite Di erence Methods Introduction to Finite Di erence Methods ME 448/548 Notes Gerald Recktenwald Portland State University Department of Mechanical Engineering gerry@pdx.edu ME 448/548: Introduction to Finite Di erence Approximation

More information

Numerical Methods - Preliminaries

Numerical Methods - Preliminaries Numerical Methods - Preliminaries Y. K. Goh Universiti Tunku Abdul Rahman 2013 Y. K. Goh (UTAR) Numerical Methods - Preliminaries 2013 1 / 58 Table of Contents 1 Introduction to Numerical Methods Numerical

More information

Announce Statistical Motivation Properties Spectral Theorem Other ODE Theory Spectral Embedding. Eigenproblems I

Announce Statistical Motivation Properties Spectral Theorem Other ODE Theory Spectral Embedding. Eigenproblems I Eigenproblems I CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Eigenproblems I 1 / 33 Announcements Homework 1: Due tonight

More information

MATH ASSIGNMENT 03 SOLUTIONS

MATH ASSIGNMENT 03 SOLUTIONS MATH444.0 ASSIGNMENT 03 SOLUTIONS 4.3 Newton s method can be used to compute reciprocals, without division. To compute /R, let fx) = x R so that fx) = 0 when x = /R. Write down the Newton iteration for

More information

BASIC COMPUTER ARITHMETIC

BASIC COMPUTER ARITHMETIC BASIC COMPUTER ARITHMETIC TSOGTGEREL GATUMUR Abstract. First, we consider how integers and fractional numbers are represented and manipulated internally on a computer. Then we develop a basic theoretical

More information

Announce Statistical Motivation ODE Theory Spectral Embedding Properties Spectral Theorem Other. Eigenproblems I

Announce Statistical Motivation ODE Theory Spectral Embedding Properties Spectral Theorem Other. Eigenproblems I Eigenproblems I CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Eigenproblems I 1 / 33 Announcements Homework 1: Due tonight

More information

More General Functions Is this technique limited to the monomials {1, x, x 2, x 3,...}?

More General Functions Is this technique limited to the monomials {1, x, x 2, x 3,...}? More General Functions Is this technique limited to the monomials {1, x, x 2, x 3,...}? Interpolation with General Sets of Functions For a general set of functions {ϕ 1,..., ϕ n }, solve the linear system

More information

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le Floating Point Number Systems Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le 1 Overview Real number system Examples Absolute and relative errors Floating point numbers Roundoff

More information

Accurate polynomial evaluation in floating point arithmetic

Accurate polynomial evaluation in floating point arithmetic in floating point arithmetic Université de Perpignan Via Domitia Laboratoire LP2A Équipe de recherche en Informatique DALI MIMS Seminar, February, 10 th 2006 General motivation Provide numerical algorithms

More information

Mathematics for Engineers. Numerical mathematics

Mathematics for Engineers. Numerical mathematics Mathematics for Engineers Numerical mathematics Integers Determine the largest representable integer with the intmax command. intmax ans = int32 2147483647 2147483647+1 ans = 2.1475e+09 Remark The set

More information

Lecture 4 Modeling, Analysis and Simulation in Logic Design. Dr. Yinong Chen

Lecture 4 Modeling, Analysis and Simulation in Logic Design. Dr. Yinong Chen Lecture 4 Modeling, Analysis and Simulation in Logic Design Dr. Yinong Chen The Engineering Design Process Define Problem and requirement Research Define Alternative solutions CAD Modeling Analysis Simulation

More information

Chemistry: The Study of Change Chang & Goldsby 12 th edition

Chemistry: The Study of Change Chang & Goldsby 12 th edition Chemistry: The Study of Change Chang & Goldsby 12 th edition modified by Dr. Hahn Chapter 1 Example 1.4 Determine the number of significant figures in the following measurements: (a)478 cm (b)6.01 g end

More information

Introduction to Scientific Computing Languages

Introduction to Scientific Computing Languages 1 / 21 Introduction to Scientific Computing Languages Prof. Paolo Bientinesi pauldj@aices.rwth-aachen.de Numerical Representation 2 / 21 Numbers 123 = (first 40 digits) 29 4.241379310344827586206896551724137931034...

More information

Introduction to Scientific Computing Languages

Introduction to Scientific Computing Languages 1 / 19 Introduction to Scientific Computing Languages Prof. Paolo Bientinesi pauldj@aices.rwth-aachen.de Numerical Representation 2 / 19 Numbers 123 = (first 40 digits) 29 4.241379310344827586206896551724137931034...

More information

SIGNIFICANT FIGURES. x 100%

SIGNIFICANT FIGURES. x 100% Page 1 SIGNIFICANT FIGURES ASSIGNED READING: Zumdahal, et.al, Chemistry (10 th ed.), Chapter 1, Sec. 4 and 5. I. Accuracy and Precision It is important to remember, here at the outset of this course, that

More information

INTRODUCTION TO COMPUTATIONAL MATHEMATICS

INTRODUCTION TO COMPUTATIONAL MATHEMATICS INTRODUCTION TO COMPUTATIONAL MATHEMATICS Course Notes for CM 271 / AMATH 341 / CS 371 Fall 2007 Instructor: Prof. Justin Wan School of Computer Science University of Waterloo Course notes by Prof. Hans

More information

Eigenproblems II: Computation

Eigenproblems II: Computation Eigenproblems II: Computation CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Eigenproblems II: Computation 1 / 31 Setup A

More information

Outline. Making Models with Polynomials: Interpolation Making Models with Monte Carlo Error, Accuracy and Convergence Floating Point

Outline. Making Models with Polynomials: Interpolation Making Models with Monte Carlo Error, Accuracy and Convergence Floating Point Outline Python, Numpy, and Matplotlib Making Models with Polynomials: Taylor Series Making Models with Polynomials: Interpolation Making Models with Monte Carlo Error, Accuracy and Convergence Floating

More information

Algebra Year 9. Language

Algebra Year 9. Language Algebra Year 9 Introduction In Algebra we do Maths with numbers, but some of those numbers are not known. They are represented with letters, and called unknowns, variables or, most formally, literals.

More information

Ordinary Differential Equations I

Ordinary Differential Equations I Ordinary Differential Equations I CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Doug James (and Justin Solomon) CS 205A: Mathematical Methods Ordinary Differential Equations I 1 / 35

More information

A Brief Introduction to Numerical Methods for Differential Equations

A Brief Introduction to Numerical Methods for Differential Equations A Brief Introduction to Numerical Methods for Differential Equations January 10, 2011 This tutorial introduces some basic numerical computation techniques that are useful for the simulation and analysis

More information

The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor

The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor Vincent Lefèvre 11th July 2005 Abstract This paper is a complement of the research report The Euclidean division implemented

More information

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane. Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane c Sateesh R. Mane 2018 3 Lecture 3 3.1 General remarks March 4, 2018 This

More information

Number Representation and Waveform Quantization

Number Representation and Waveform Quantization 1 Number Representation and Waveform Quantization 1 Introduction This lab presents two important concepts for working with digital signals. The first section discusses how numbers are stored in memory.

More information

Numerical Methods. Dr Dana Mackey. School of Mathematical Sciences Room A305 A Dana Mackey (DIT) Numerical Methods 1 / 12

Numerical Methods. Dr Dana Mackey. School of Mathematical Sciences Room A305 A   Dana Mackey (DIT) Numerical Methods 1 / 12 Numerical Methods Dr Dana Mackey School of Mathematical Sciences Room A305 A Email: Dana.Mackey@dit.ie Dana Mackey (DIT) Numerical Methods 1 / 12 Practical Information The typed notes will be available

More information

Tunable Floating-Point for Energy Efficient Accelerators

Tunable Floating-Point for Energy Efficient Accelerators Tunable Floating-Point for Energy Efficient Accelerators Alberto Nannarelli DTU Compute, Technical University of Denmark 25 th IEEE Symposium on Computer Arithmetic A. Nannarelli (DTU Compute) Tunable

More information

Chapter 1 Computer Arithmetic

Chapter 1 Computer Arithmetic Numerical Analysis (Math 9372) 2017-2016 Chapter 1 Computer Arithmetic 1.1 Introduction Numerical analysis is a way to solve mathematical problems by special procedures which use arithmetic operations

More information

Heinemann VCE Zone textbook reference General Mathematics

Heinemann VCE Zone textbook reference General Mathematics Contents Cross-reference table for TI-Nspire CAS skills required for Heinemann VCE Zone: General, Heinemann VCE Zone: Further and Heinemann VCE Zone: Specialist. Code Description TS.1 Rounding off 4 TS.2

More information

Applied Mathematics 205. Unit 0: Overview of Scientific Computing. Lecturer: Dr. David Knezevic

Applied Mathematics 205. Unit 0: Overview of Scientific Computing. Lecturer: Dr. David Knezevic Applied Mathematics 205 Unit 0: Overview of Scientific Computing Lecturer: Dr. David Knezevic Scientific Computing Computation is now recognized as the third pillar of science (along with theory and experiment)

More information

Measurement 4: Scientific Notation

Measurement 4: Scientific Notation Q Skills Review The Decimal System Measurement 4: Scientific Notation Dr. C. Stewart We are so very familiar with our decimal notation for writing numbers that we usually take it for granted and do not

More information

Ex code

Ex code Ex. 8.4 7-4-2-1 code Codeconverter 7-4-2-1-code to BCD-code. When encoding the digits 0... 9 sometimes in the past a code having weights 7-4-2-1 instead of the binary code weights 8-4-2-1 was used. In

More information

1 ERROR ANALYSIS IN COMPUTATION

1 ERROR ANALYSIS IN COMPUTATION 1 ERROR ANALYSIS IN COMPUTATION 1.2 Round-Off Errors & Computer Arithmetic (a) Computer Representation of Numbers Two types: integer mode (not used in MATLAB) floating-point mode x R ˆx F(β, t, l, u),

More information

Round-off Errors and Computer Arithmetic - (1.2)

Round-off Errors and Computer Arithmetic - (1.2) Round-off Errors and Comuter Arithmetic - (.). Round-off Errors: Round-off errors is roduced when a calculator or comuter is used to erform real number calculations. That is because the arithmetic erformed

More information

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2 2.29 Numerical Fluid Mechanics Fall 2011 Lecture 2 REVIEW Lecture 1 1. Syllabus, Goals and Objectives 2. Introduction to CFD 3. From mathematical models to numerical simulations (1D Sphere in 1D flow)

More information

Every time a measurement is taken, we must be aware of significant figures! Define significant figures.

Every time a measurement is taken, we must be aware of significant figures! Define significant figures. SCHM 103: FUNDAMENTALS OF CHEMISTRY Ch. 2: Numerical Side of Chemistry Types of data collected in experiments include: Qualitative: Quantitative: Making Measurements Whenever a piece of data is collected,

More information

Chapter 1. Numerical Errors. Module No. 1. Errors in Numerical Computations

Chapter 1. Numerical Errors. Module No. 1. Errors in Numerical Computations Numerical Analysis by Dr. Anita Pal Assistant Professor Department of Mathematics National Institute of Technology Durgapur Durgapur-73209 email: anita.buie@gmail.com . Chapter Numerical Errors Module

More information

Scientific Notation. Sig. Figs. Estimation Density. Unit cancelation

Scientific Notation. Sig. Figs. Estimation Density. Unit cancelation Unit cancelation Sig. Figs. Scientific Notation Estimation Density 100 100 100 100 100 200 200 200 200 200 300 300 300 300 300 400 400 400 400 400 500 500 500 500 500 When doing unit conversions, this

More information

On various ways to split a floating-point number

On various ways to split a floating-point number On various ways to split a floating-point number Claude-Pierre Jeannerod Jean-Michel Muller Paul Zimmermann Inria, CNRS, ENS Lyon, Université de Lyon, Université de Lorraine France ARITH-25 June 2018 -2-

More information

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013 Fall 2013 Student Responsibilities Reading: Textbook, Section 3.7, 4.1, & 5.2 Assignments: Sections 3.6, 3.7, 4.1 Proof Worksheets Attendance: Strongly Encouraged Overview 3.6 Integers and Algorithms 3.7

More information

CS4495/6495 Introduction to Computer Vision. 8C-L3 Support Vector Machines

CS4495/6495 Introduction to Computer Vision. 8C-L3 Support Vector Machines CS4495/6495 Introduction to Computer Vision 8C-L3 Support Vector Machines Discriminative classifiers Discriminative classifiers find a division (surface) in feature space that separates the classes Several

More information

Ordinary Differential Equations I

Ordinary Differential Equations I Ordinary Differential Equations I CS 205A: Mathematical Methods for Robotics, Vision, and Graphics Justin Solomon CS 205A: Mathematical Methods Ordinary Differential Equations I 1 / 27 Theme of Last Three

More information

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd() Student Responsibilities Week 8 Mat 2345 Week 8 Reading: Textbook, Section 3.7, 4.1, & 5.2 Assignments: Sections 3.6, 3.7, 4.1 Induction Proof Worksheets Attendance: Strongly Encouraged Fall 2013 Week

More information

Advanced topic: Space complexity

Advanced topic: Space complexity Advanced topic: Space complexity CSCI 3130 Formal Languages and Automata Theory Siu On CHAN Chinese University of Hong Kong Fall 2016 1/28 Review: time complexity We have looked at how long it takes to

More information

ESO 208A: Computational Methods in Engineering. Saumyen Guha

ESO 208A: Computational Methods in Engineering. Saumyen Guha ESO 208A: Computational Methods in Engineering Introduction, Error Analysis Saumyen Guha Department of Civil Engineering IIT Kanpur What is Computational Methods or Numerical Methods in Engineering? Formulation

More information

Base unit-a defined unit of measurement based on an object or event in the physical world. Length

Base unit-a defined unit of measurement based on an object or event in the physical world. Length Base unit-a defined unit of measurement based on an object or event in the physical world Five base units: Temperature Mass Length Time Energy Derived unit-a unit of measurement defined by a combination

More information

Homework 2 Foundations of Computational Math 1 Fall 2018

Homework 2 Foundations of Computational Math 1 Fall 2018 Homework 2 Foundations of Computational Math 1 Fall 2018 Note that Problems 2 and 8 have coding in them. Problem 2 is a simple task while Problem 8 is very involved (and has in fact been given as a programming

More information