1 An Introduction to the Quality of Computed Solutions Sven Hammarling NAG Ltd, Oxford

Slides:



Advertisements
Similar presentations
Computational Physics Linear Algebra Dr. Guy Tel-Zur Sunset in Caruaru by Jaime JaimeJunior. publicdomainpictures.netVersion , 14:00.
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.
Fabián E. Bustamante, Spring 2007 Floating point Today IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time.
CS 351/ IT 351 Modeling and Simulation Technologies Errors In Models Dr. Jim Holten.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Solving Linear Systems (Numerical Recipes, Chap 2)
Chapter 2, Linear Systems, Mainly LU Decomposition.
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
1cs542g-term Notes  Assignment 1 is out (questions?)
University of Washington Today Topics: Floating Point Background: Fractional binary numbers IEEE floating point standard: Definition Example and properties.
CS267 L13 Floating Point.1 Demmel Sp 1999 CS 267 Applications of Parallel Computers Lecture 13: Floating Point Arithmetic James Demmel
COS 323: Computing for the Physical and Social Sciences Szymon Rusinkiewicz.
Round-Off and Truncation Errors
MA5233: Computational Mathematics
1cs542g-term CS542G - Breadth in Scientific Computing.
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.
Scientific Computing Algorithm Convergence and Root Finding Methods.
Introduction and Analysis of Error Pertemuan 1
Numerical Computations in Linear Algebra. Mathematically posed problems that are to be solved, or whose solution is to be confirmed on a digital computer.
® Backward Error Analysis and Numerical Software Sven Hammarling NAG Ltd, Oxford
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.
Numeric Processing Chapter 6, Exploring the Digital Domain.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
ME 142 Engineering Computation I Computer Precision & Round-Off Error.
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
© David Kirk/NVIDIA and Wen-mei W. Hwu, University of Illinois, Urbana-Champaign 1 ECE408 Applied Parallel Programming Lecture 16 - Floating.
MECN 3500 Inter - Bayamon Lecture 3 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Programming assignment #2 Solving a parabolic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Numerical Analysis Intro to Scientific Computing.
Introduction to GAMS, Netlib, Numerical Recipes CS 3414.
Meeting 15 Introduction to Numerical Methods Error Analysis.
Perfidious Polynomials and Elusive Roots Zhonggang Zeng Northeastern Illinois University Nov. 2, 2001 at Northern Illinois University.
Numerical Methods Solution of Equation.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA
Announcements Read Chapters 11 and 12 (sections 12.1 to 12.3)
1 Chapter 7 Numerical Methods for the Solution of Systems of Equations.
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA Shirley Moore CPS5401 Fall 2013 svmoore.pbworks.com November 12, 2012.
Intro to Scientific Libraries Intro to Scientific Libraries Blue Waters Undergraduate Petascale Education Program May 29 – June
Numerical Analysis CC413 Propagation of Errors. 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate.
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.
Introduction to Numerical Analysis I
Machine arithmetic and associated errors Introduction to error analysis Class II.
Chapter 2, Linear Systems, Mainly LU Decomposition
ME 142 Engineering Computation I
Topics IEEE Floating Point Standard Rounding Floating Point Operations
CS 105 “Tour of the Black Holes of Computing!”
Linear Systems, Mainly LU Decomposition
IEEE floating point format
Chapter 6 Floating Point
Topic 3d Representation of Real Numbers
Chapter 2 ERROR ANALYSIS
Errors in Numerical Methods
Roundoff and Truncation Errors
© University of Liverpool
Errors in Numerical Methods
Approximations and Round-Off Errors Chapter 3
Chapter 1 Introduction(1.1)
CS 105 “Tour of the Black Holes of Computing!”
Topic 3d Representation of Real Numbers
Roundoff and Truncation Errors
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Numerical Modeling Ramaz Botchorishvili
CS 105 “Tour of the Black Holes of Computing!”
Presentation transcript:

1 An Introduction to the Quality of Computed Solutions Sven Hammarling NAG Ltd, Oxford

2 Plan of Talk Introduction Floating point numbers and IEEE arithmetic Condition, stability and error analysis with examples Implications for software. –LAPACK and NAG Other approaches Summary

3 Introduction to NAG

4 NAG History Nottingham Algorithms Group Mark 1 NAG Library NAG moved to Oxford, renamed Numerical Algorithms Group NAG Ltd, a non-profit company NAG Inc established in USA NAG Ltd financially self-sufficient NAG GmbH established Nihon NAG KK established

5 What does non-profit mean? No shareholders, no owner surplus is re-invested in the Company

6 How many people work at NAG? Distributors worldwide

7 NAG Products and Services Product Lines –Numerical Libraries –Statistical Systems –NAGWare: Compiler and tools –Visualization and Graphics –PDE Solutions Consultancy Customer Support or

8 NAG Numerical Libraries F77 F90 C Parallel SMPMPI FL90Plus

9 Quality of Computed Solutions

10 Quality of Computed Solutions The quality of computed solutions is concerned with assessing how good a computed solution is in some appropriate measure

11 Software Quality Quality software should implement reliable algorithms and should provide measures of solution quality

12 Floating Point Numbers Floating point numbers are a subset of the real numbers that can be conveniently represented in the finite word length of a computer, without unduly restricting the range of numbers represented For example, the IEEE standard uses 64 bits to represent double precision numbers in the approximate range

13 Floating Point Numbers - Representation

14 Floating Point Numbers - Example

15 Floating Point Numbers - Example (cont’d)

16 IEEE Arithmetic Standard ANSI/IEEE Standard is a standard for binary arithmetic (b = 2). The standard specifies: Floating point number formats Results of the basic floating point operations Rounding modes Signed zero, infinity ( ) and not-a-number (NaN) Floating point exceptions and their handling Conversion between formats Most modern machines use IEEE arithmetic.

17 IEEE Arithmetic Formats

18 Why Worry about Computed Solutions? Tacoma bridge collapse North Sea oil rig collapse Vancouver stock exchange index, Jan 1982 to Nov 1983 Ariane 5 rocket, flight 501, failure, 4 June 1996 Patriot missile, 25 Feb 1991 Auckland Bridge London millennium bridge

19 Tacoma Bridge

20 Auckland Bridge, 1975

21 Millennium Bridge, 2000

22 Web Sites Disasters attributable to bad numerical computing: Numerical problems: RISKS-LIST: London millennium bridge:

23 Example - Means

24 Example - Sample Variance

25 Excel Example: Standard Deviation

26 Overflow/Underflow Example: Modulus of a Complex Number

27 Excel Example: Standard Deviation - Overflow

28 Stability The stability of a method for solving a problem is concerned with the sensitivity of the method to (rounding) errors in the solution process A method that guarantees as accurate a solution as the data warrants is said to be stable, otherwise the method is unstable

29 Condition The condition of a problem is concerned with the sensitivity of the problem to perturbations in the data A problem is ill-conditioned if small changes in the data cause relatively large changes in the solution. Otherwise a problem is well- conditioned

30 Condition Examples

33 Condition Examples (cont’d)

35 Condition Examples (cont’d)

37 Condition Number for Linear Equations

38 Condition Number Example

39 Stability Examples

40 Stability Examples (Contd) recursive.m

41 Stability Examples (Contd)

42 Stability Examples (cont’d) brecursive.m

43 Error Analysis Error analysis is concerned with establishing whether or not an algorithm is stable for the problem in hand A forward error analysis is concerned with how close the computed solution is to the exact solution A backward error analysis is concerned with how well the computed solution satisfies the problem to be solved

Example

45 The Purpose of Error Analysis “The clear identification of the factors determining the stability of an algorithm soon led to the development of better algorithms. The proper understanding of inverse iteration for eigenvectors and the development of the QR algorithm by Francis are the crowning achievements of this line of research. “For me, then, the primary purpose of the rounding error analysis was insight.” Wilkinson, 1986 Bulletin of the IMA, Vol 22, p197

46

47 Backward Error and Perturbation Analysis

Condition and Error Analysis

49 LAPACK Systems of linear equations Linear least squares problems Eigenvalue and singular value problems, including generalized problems Matrix factorizations Condition and error estimates The BLAS as a portability layer Linear Algebra PACKage for high-performance computers Dense and banded linear algebra for Shared Memory

LAPACK and Error Bounds “In Addition to providing faster routines than previously available, LAPACK provides more comprehensive and better error bounds. Our goal is to provide error bounds for most quantities computed by LAPACK.” LAPACK Users’ Guide, Chapter 4 – Accuracy and Stability

Error Bounds in LAPACK The Users’ Guide gives details of error bounds and code fragments to compute those bounds. In many cases the routines return the bounds directly

Error Bounds in LAPACK: Example

54 ODE Software Example NAG routine D02PZF returns global error estimates for the Runge-Kutta solvers D02PCF and D02PDF: D02PCZ( RMSERR, ERRMAX, TERRMX,…) RMSERR: Approximate Root mean square error ERRMAX: Max approximate true error TERRMX: Point at which max approximate true error occurred (These routines are based upon RKSUITE)

What to do if Software does not Provide Error Estimates? Run the problem with perturbed data Better still, use a software tool such as PRECISE which allows you to perform a stochastic analysis Put pressure on developers to provide estimates

PRECISE Provides a module for statistical backward error analysis Provides a module for sensitivity analysis index.htmlhttp:// index.html

Quality of Reliable Software

58 CADNA CADNA is another package with the same aims as PRECISE It is now free to academics

59 Cancellation Using four figure decimal arithmetic

60 Interval Analysis Interval arithmetic works on intervals that contain the exact solution Interval analysis can provide automatic error bounds for a number of problems See

61 Summary Error analysis gives insight In linear algebra we usually aim for a backward error analysis Be concerned about the quality of computed solutions Use quality software, complain about low quality software Write quality software and be proud of your results

62 Quote “You have been solving these damn problems better than I can pose them.” Sir Edward Bullard, Director NPL, in a remark to Wilkinson. (mid 1950s.) See NAG Newsletter 2/83, page 11

References [1] E. Anderson, Z. Bai, C. H. Bischof, J. Demmel, J. J. Dongarra, J. Du Croz, A. Greenbaum, S. Hammarling, A. McKenney, S. Blackford & D. C. Sorensen. LAPACK Users’ Guide, 3 rd Edition, SIAM, [2] F. Chaitin-Chatelin & V. Frayssé. Lectures on Finite Precision Computations, SIAM, [3] G. H. Golub & C. F. Van Loan. Matrix Computations, 3 rd Edition, The Johns Hopkins University Press, [4] N. J. Higham. Accuracy and Stability of Numerical Algorithms, 2 nd edition, SIAM, [5] [6]

References (cont’d) [7] F. S. Acton. Numerical Methods that Usually Work. Harper and Row, [8] G. E. Forsythe. What is a Satisfactory Quadratic Equation Solver. In Constructive Aspects of the Fundamental Theorem of Algebra, B. Dejon and P. Henrici, P., editors, pages 53-61, Wiley, [9] G. E. Forsythe. Pitfalls in Computation, or Why a Math Book isn't enough. Amer. Math. Monthly, 9: , [10] J. H. Wilkinson. The Perfidious Polynomial. In Studies in Numerical Analysis, G. H. Golub, editor, volume 24 of Studies in Mathematics, Mathematical Association of America, Washington D.C., pages 1-24, 1984.