Floating Point Numbers: Understanding Precision and Significant Digit Cancellation, Exercises of Machine Learning

The concepts of floating point numbers, their minimum and maximum values, and the cancellation of significant digits during arithmetic operations. Dr. Hanif durad provides examples using matlab to illustrate these concepts and highlights the imprecision that can result from significant digit cancellation.

Typology: Exercises

2011/2012

Uploaded on 07/19/2012

zaraa
zaraa 🇵🇰

6 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Floating Point Numbers
>> eps
ans =
2.2204e-016
>> realmin
ans =
2.2251e-308
>> realmax
ans =
1.7977e+308
Dr. Hanif Durad 2
SCMO, P-35
pf3
pf4

Partial preview of the text

Download Floating Point Numbers: Understanding Precision and Significant Digit Cancellation and more Exercises Machine Learning in PDF only on Docsity!

Floating Point Numbers>> epsans =

2.2204e-

realminans =

2.2251e-

realmaxans =

1.7977e+

Dr. Hanif Durad

SCMO, P-

Floating Point Numbers

a = 1; b=1; while a+b ~= a; b=b/2; end>> aa =

bb =

1.1102e-

a+bans =

Dr. Hanif Durad

cancellation of significant digits

x = 1.0e-15x =

1.0000e-

((1+x)-1)/xans =

This result is rather imprecise, the relative error being larger than11%!

Dr. Hanif Durad