Chapter 1 Scientific Computing 1.Computer Arithmetic (1.3) 2.Approximation in Scientific Computing (1.2) January 7.

Slides:



Advertisements
Similar presentations
CENG536 Computer Engineering department Çankaya University.
Advertisements

Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved Floating-point Numbers.
Floating Point Numbers
COMP3221: Microprocessors and Embedded Systems Lecture 14: Floating Point Numbers Lecturer: Hui Wu Session 2, 2004.
Round-Off and Truncation Errors
1 CSE1301 Computer Programming Lecture 30: Real Number Representation.
CSE1301 Computer Programming Lecture 33: Real Number Representation
Dr Damian Conway Room 132 Building 26
Chapter 5 Floating Point Numbers. Real Numbers l Floating point representation is used whenever the number to be represented is outside the range of integer.
Revision.
1 CSC 1401 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
CSE 378 Floating-point1 How to represent real numbers In decimal scientific notation –sign –fraction –base (i.e., 10) to some power Most of the time, usual.
1 Error Analysis Part 1 The Basics. 2 Key Concepts Analytical vs. numerical Methods Representation of floating-point numbers Concept of significant digits.
1 Module 2: Floating-Point Representation. 2 Floating Point Numbers ■ Significant x base exponent ■ Example:
Representation and Conversion of Numeric Types 4 We have seen multiple data types that C provides for numbers: int and double 4 What differences are there.
Solving Quadratic Equations
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
2.2 Errors. Why Study Errors First? Nearly all our modeling is done on digital computers (aside: what would a non-digital analog computer look like?)
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Table of Contents First note this equation has "quadratic form" since the degree of one of the variable terms is twice that of the other. When this occurs,
Chapter 1 Scientific Computing Approximation in Scientific Computing (1.2) January 12, 2010.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 22, 2004 Lecture Number: 24.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Floating Point (a brief look) We need a way to represent –numbers with fractions, e.g., –very small numbers, e.g., –very large numbers,
Computer Science Engineering B.E.(4 th sem) c omputer system organization Topic-Floating and decimal arithmetic S ubmitted to– Prof. Shweta Agrawal Submitted.
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?)
Lecture 5. Topics Sec 1.4 Representing Information as Bit Patterns Representing Text Representing Text Representing Numeric Values Representing Numeric.
ECEG-3202: Computer Architecture and Organization, Dept of ECE, AAU 1 Floating-Point Arithmetic Operations.
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.
Bell Ringer Simplify by combining like terms: 1. 4x + 3y – 5y + 2x = 6x – 2y 2. -5x – 3y + 2x – 7y = -3x – 10y y + 4x – 6y = 4x – 3y + 9.
1 Number Systems Lecture 10 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
3.8 Warm Up Write the function in vertex form (by completing the square) and identify the vertex. a. y = x² + 14x + 11 b. y = 2x² + 4x – 5 c. y = x² -
Chapter 10.7 Notes: Solve Quadratic Equations by the Quadratic Formula Goal: You will solve quadratic equations by using the Quadratic Formula.
CSC 4250 Computer Architectures September 5, 2006 Appendix H. Computer Arithmetic.
Numerical Analysis CC413 Propagation of Errors.
SOL’s Covered: Topics: Exponents Negative Exponents Scientific Notation (positive exponent AND negative exponent) Fractions, Decimals, Percents Perfect.
Solve by factoring. x² = - 4 – 5x 2,. Solve by factoring. n² = -30 – 11n -4 and -1.
Exponents And how they make life easier! Exponents Exponents are used to write numbers in scientific notation. Exponents are powers of ten. 10 x 10 =
EET 109 Math January 7, 2016 Week 1 Day 2. Save your syllabus for future reference.
Numbers in Computers.
Scientific Notation (large numbers) Textbook page 114.
Numerical Analysis CC413 Propagation of Errors. 2 In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate.
Module 2.2 Errors 03/08/2011. Sources of errors Data errors Modeling Implementation errors Absolute and relative errors Round off errors Overflow and.
Cosc 2150: Computer Organization Chapter 9, Part 3 Floating point numbers.
Floating Point Representations
Integer Division.
Floating Point Numbers: x 10-18
Scientific Notation.
Chapter 6 Floating Point
Review for Test: Solving
Math 20-1 Chapter 4 Quadratic Equations
Data Representation and Arithmetic Algorithms
INTRODUCTION TO SCIENTIFIC COMPUTING
Number Representations
Scientific Notation.
Floating Point Arithmetic
Chapter Ten Exponents and Scientific Notation
How to represent real numbers
How to represent real numbers
Approximations and Round-Off Errors Chapter 3
Data Representation and Arithmetic Algorithms
Quadratic Equations.
Chapter 3 Quadratic Equations
Scientific Notation.
Chapter3 Fixed Point Representation
Chapter Ten Exponents and Scientific Notation
Number Representations
Presentation transcript:

Chapter 1 Scientific Computing 1.Computer Arithmetic (1.3) 2.Approximation in Scientific Computing (1.2) January 7

Floating-Point Number System (FPNS) Mantissa Exponent Fraction

Examples 54 In base-10 system as 54 = (5 + 4/10) x 10 1 = 5.4 x 10 1 mantissa = 5.4, fraction = 0.4, exponent = 1 In base-2 system 54 = ( 0 + 1x x x x x2 5 ) = ( ) = ( 1 + 1/ (2 1 ) + 0/(2 2 ) + 1/(2 3 ) + 1/(2 4 ) + 0/(2 5 )) x 2 5 mantissa = , fraction = , exponent=5

Normalization 54 = ( 1 + 1/ (2 1 ) + 0/(2 2 ) + 1/(2 3 ) + 1/(2 4 ) + 0/(2 5 )) x 2 5 = x 32 (normalized) = ( 0 + 1/(2 1 ) + 1/(2 2 )+ 0/(2 3 ) + 1/(2 4 ) + 1/(2 5 )+0/(2 6 ) ) x 2 6 (not normalized)

There are = 254 possible exponent values How to represent zero?

OFL = when all d 0, …, d p-1 = beta - 1 Underflow level Overflow level

What are the 25 numbers?

Online Demo at

Absolute and Relative Errors Example Approximate with 4.3x10 has absolute error = relative error =approx=

Floating-Point Arithmetics

Cancellation

For example: with base = 10, p =3. Take x= 23115, y = 23090, there difference of 25 is comparatively much smaller than either x or y (using chopping) what is the difference x-y in this FPNS?

Quadratic Formula If the coefficients are too large or too small, overflow and underflow could occur. Overflow can be avoided by scaling the coefficients. Cancellation between –b and square root can be avoid by using

Example (pages 26-27) Take ( base = 10, p=4) a= , b=-98.78, c=5.015 The correct roots (to ten significant digits) , b 2 -4ac = 9756, its square-root is The computed roots using standard formula 1972, Using the second formula 1003,