1.02k likes | 1.63k Views
Numerical Analysis. EE, NCKU Tien-Hao Chang (Darby Chang). In the previous slide. Why numerical methods? differences between human and computer a very simple numerical method What is algorithm? definition and components three problems and three algorithms Convergence
E N D
Numerical Analysis EE, NCKU Tien-Hao Chang (Darby Chang)
In the previous slide • Why numerical methods? • differences between human and computer • a very simple numerical method • What is algorithm? • definition and components • three problems and three algorithms • Convergence • compare rate of convergence
In this slide • Error (motivation) • Floating point number system • difference to real number system • problem of roundoff • Introduced/propagated error • Focus on numerical methods • three bugs
Let’s start from error • Numerical methods are generally designed to determine approximation solutions • 3 categories of error types • modeling: made when you decide the algorithm • discretization/truncation: conversion from continuous to discrete and/or truncation of an infinite series • roundoff/data: not due to the formulation of a numerical method, caused by the data representation (in computer)
Can be analyzed • Numerical methods are generally designed to determine approximation solutions • 3 categories of error types • modeling: made when you decide the algorithm • discretization/truncation: conversion from continuous to discrete and/or truncation of an infinite series • roundoff/data: not due to the formulation of a numerical method, caused by the data representation (in computer)
Should be prevented • Numerical methods are generally designed to determine approximation solutions • 3 categories of error types • modeling: made when you decide the algorithm • discretization/truncation: conversion from continuous to discrete and/or truncation of an infinite series • roundoff/data: not due to the formulation of a numerical method, caused by the data representation (in computer)
1.3 Floating Point Number Systems
Restriction of must not be zero (except when the number being represented is 0)
Floating point vs. real number • Discrete vs. continuous • continuous means that between any two numbers, there are infinitely many other numbers • Finite vs. infinite • number of element and range of values • a floating point number system contains its smallest/largest element • underflow/overflow
Floating point vs. real number • Nonuniform vs. uniform • real numbers are uniformly distributed • in a floating point number system, the elements **** *** **** are more closely spaced • think about the difference between two adjacent elements while the exponent changes hint
Floating point vs. real number • Nonuniform vs. uniform • real numbers are uniformly distributed • in a floating point number system, the elements **** *** **** are more closely spaced • think about the difference between two adjacent elements while the exponent changes
Floating point vs. real number • Nonuniform vs. uniform • real numbers are uniformly distributed • in a floating point number system, the elements near the zero are more closely spaced • think about the difference between two adjacent elements while the exponent changes
Floating point system is discrete, finite and nonuniform
Roundoff error • When the number is outside the system • Select an element to represent the number • chop • round • A number to its floating point equivalent • y→fl(y)
Roundoff error • When the number is outside the system • Select an element to represent the number • chop • round • A number to its floating point equivalent
Machine precision/epsilon • The error bound is independent of the number, y • It depends on • base () • the number of digits (k) • The bound is a function of the hardware implementation • Cause of roundoff error
So far, we talked about floating point number systems in abstract
Then, what systems are we likely to encounter in practice?
Real floating point system • 1970s • begun to develop a standard binary floating point numbers to eliminate inconsistencies • 1985 • IEEE • Binary Floating Point Arithmetic Standard 754 • The IEEE Standard • F(2,24,-125,128), single precision • F(2,53,-1021,1024), double precision
1.4 Floating Point Arithmetic
Motivation • Floating point arithmetic stands for the mathematics on the computer, but why should we know that? • The IEEE Standard • seems pretty accurate • However,
Numerical methods perform a sequence of calculations on computer, where each operation introduces some roundoff error
http://www.radgraphics.net/images/main/atomic%20explosion%20-%204.jpghttp://www.radgraphics.net/images/main/atomic%20explosion%20-%204.jpg when they are accumulated
Typical arithmetic • Three steps • operand its floating point equivalent • the exact arithmetic • result its floating point equivalent
Not associative • We should perform the arithmetic in ********* order to obtain the most accurate result question
Not associative • We should perform the arithmetic in ********* order to obtain the most accurate result
Not associative • We should perform the arithmetic in Ascending order to obtain the most accurate result
In FP arithmetic, always notice the number of significant digits and the least significant bits
Propagated error can be large even if the introduced error is small