Docsity

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

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