Page 1 of 1

Machine epsilon of the EzSBC1

Posted: Sun Jun 21, 2015 10:19 am
by cdeaglejr
Here's a short program that determines the machine epsilon of the EzSBC1. Machine epsilon can be defined several ways;

(1) that number, when added to one, is still one (according to the computer).

(2) the distance from 1.0 to the next largest floating point number.

Machine epsilon is important in numerical analysis because it can be used to "control" the number of iterations (convergence) of an algorithm. It's also an indication or guideline when looking for a "reasonable" answer without spending lots of CPU cycles to gain very little in the final result.

------------------------------------------

' determine EzSBC1 machine epsilon

x = 1.0

WHILE ((1.0 + x) > 1.0)

x = x/2.0

PRINT "x = ", x

WEND

PRINT " "
PRINT "machine epsilon = ", x

END

Here are the results for EzSBC1.

Start program
x = 0.5
x = 0.25
x = 0.125
x = 0.0625
x = 0.03125
x = 0.015625
x = 0.0078125
x = 0.00390625
x = 0.001953125
x = 0.0009765625
x = 0.00048828125
x = 0.000244140625
x = 0.0001220703125
x = 0.0000610351562
x = 0.0000305175781
x = 0.00001525878906
x = 0.00000762939453
x = 0.000003814697266
x = 0.000001907348633
x = 0.000000953674316
x = 0.000000476837158
x = 0.000000238418579
x = 0.0000001192092895
x = 0.00000005960464478
x = 0.00000002980232239
x = 0.00000001490116119
x = 0.000000007450580597
x = 0.000000003725290298
x = 0.000000001862645149
x = 9.31322574E-10
x = 4.65661287E-10
x = 2.328306436E-10
x = 1.164153218E-10
x = 5.82076609E-11
x = 2.910383045E-11
x = 1.455191522E-11
x = 7.27595761E-12
x = 3.637978807E-12
x = 1.818989403E-12
x = 9.09494701E-13
x = 4.547473509E-13
x = 2.273736754E-13
x = 1.136868377E-13
x = 5.684341886E-14
x = 2.842170943E-14
x = 1.421085471E-14
x = 7.105427358E-15
x = 3.552713679E-15
x = 1.776356839E-15
x = 8.88178419E-16
x = 4.440892098E-16
x = 2.220446049E-16
x = 1.110223024E-16

machine epsilon = 1.110223024E-16

Since the EzSBC1 uses IEEE floating point math, the computer representation of floating point numbers is excellent.

Re: Machine epsilon of the EzSBC1

Posted: Wed Jun 24, 2015 3:52 am
by Andries Pretorius
Thanks!