Docsity

Understanding Floating-Point Numbers & Computer Arithmetic in MATH 441/541 - Prof. Erin K., Study notes of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
MATH 441/541 - Numerical Analysis
First Meeting: Computer Number Representation and Arithmetic
Thursday, August 23, 2007
Outline
1. Internal Number Representation
(a) Bases (Binary, Decimal, Hexidecimal, Converting)
(b) Computer (Floating-Point) Representation of Numbers (IEEE Standard) – BINARY
y= (−1)s2(c−shift)(1 + f)
where
s= sign bit
c−shift = shifted exponent (characteristic)
f= fractional part (mantissa)
with double precision-floating point numbers using 64 bit representation:
1 bit for sign, s
11 bits for exponent, c
52 bits for fraction, f
sexponent, cfraction, f
· · ·
i. Determining the value of shift.
ii. The number of numbers we can represent exactly.
iii. The range of the numbers we can represent.
iv. Plotting computer numbers (to see the meshing pattern).
v. Determining the pattern:
A. Increasing/decreasing number of bits for c=⇒?
B. Increasing/decreasing number of bits for f=⇒?
vi. Definitions:
A. Underflow
B. Overflow
C. Machine Epsilon,
D. Unit Roundoff, u
(c) Normalized k-Digit DECIMAL Floating-Point Representation of Numbers
±0.d1d2d3· · · dk×10n, d16= 0, di∈ {0,1,· · · ,9}
i. Rounding vs. Chopping
ii. Absolute and Relative Error
pf2

Partial preview of the text

Download Understanding Floating-Point Numbers & Computer Arithmetic in MATH 441/541 - Prof. Erin K. and more Study notes Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

MATH 441/541 - Numerical Analysis First Meeting: Computer Number Representation and Arithmetic Thursday, August 23, 2007

Outline

  1. Internal Number Representation (a) Bases (Binary, Decimal, Hexidecimal, Converting) (b) Computer (Floating-Point) Representation of Numbers (IEEE Standard) – BINARY

y = (−1)s^2 (c−shif t)^ (1 + f ) where s = sign bit c − shif t = shifted exponent (characteristic) f = fractional part (mantissa)

with double precision-floating point numbers using 64 bit representation: 1 bit for sign, s 11 bits for exponent, c 52 bits for fraction, f s exponent, c fraction, f · · ·

i. Determining the value of shif t. ii. The number of numbers we can represent exactly. iii. The range of the numbers we can represent. iv. Plotting computer numbers (to see the meshing pattern). v. Determining the pattern: A. Increasing/decreasing number of bits for c =⇒? B. Increasing/decreasing number of bits for f =⇒? vi. Definitions: A. Underflow B. Overflow C. Machine Epsilon,  D. Unit Roundoff, u (c) Normalized k-Digit DECIMAL Floating-Point Representation of Numbers ± 0 .d 1 d 2 d 3 · · · dk × 10 n, d 1 6 = 0, di ∈ { 0 , 1 , · · · , 9 }

i. Rounding vs. Chopping ii. Absolute and Relative Error

  1. Computer Arithmetic

(a) Definition of f l(x), floating-point representation of x:

f l(x) = x (1 + δ), where |δ| < u (unit roundoff)

(b) Operations: ⊕, , ⊗, ÷© (c) Stable Operations (proving or disproving) (d) Handout on Computations to Be Wary Of

  1. Rates of Convergence and Terminology

(a) {αn} → α with a rate of convergence O(βn)