Professional Documents
Culture Documents
Lab 2
Lab 2
Task 1:
Experiment 2:
Experiment 3:
After Computation of the machine epsilon of my device on the Octave GUI the
following result was gotten:
epsilon = 0.025000
r = 0.9750
epsilon = 0.012500
r = 0.9875………
epsilon = 4.4409e-17
r=1
While the following result was gotten on the python IDE
The value of r is = 1.0
The machine epsilon is = 1.1102230246251565e-16
Experiment 4:
Computing the machine epsilon using the format long, gave the values:
epsilon = 2.500000000000000e-02
r = 0.975000000000000
epsilon = 1.250000000000000e-02
r = 0.987500000000000
epsilon = 6.250000000000000e-03
r = 0.993750000000000…..
epsilon = 8.881784197001253e-17
r = 1.000000000000000
epsilon = 4.440892098500626e-17
r=1
Experiment 5:
After calculating the different values of Epsilon as different divisors, the following
results were produced:
With divisor 3.0, the values are:
epsilon = 0.025000
r = 0.9750
epsilon = 8.3333e-03
r = 0.9917…..
epsilon = 1.2142e-16
r = 1.0000
epsilon = 4.0474e-17
r=1
With divisor 3.5, the vales are:
epsilon = 0.025000
r = 0.9750
epsilon = 7.1429e-03
r = 0.9929……
epsilon = 1.7872e-16
r = 1.0000
epsilon = 5.1063e-17
r=1
With divisor 5.0, the vales are:
epsilon = 0.025000
r = 0.9750
epsilon = 5.0000e-03
r = 0.9950……
epsilon = 2.6214e-16
r = 1.0000
epsilon = 5.2429e-17
r=1
Experiment 6:
After plotting a graph to describe the values at different value ranges, the following
image shows the graphs displayed in the octave GUI for each value:
Experiment 6:
The code is an iterative process where `epsilon` is successively divided by 2.0 first
then other values later, and the value of `r` is updated accordingly. The loop
continues until the absolute value of `r < 1.0` is no longer less than 1.0. This loop
effectively refines the value of `epsilon` to achieve a desired condition involving `r`.
Task 3:
Experiment 1:
After using each machine epsilon value to get my machine gamma, the following
results were gotten:
Machine Epsilon: 0.0250003 Machine Gamma: 2.775558e-18
Machine Epsilon: 0.008333 Machine Gamma: 9.251822e-19
Machine Epsilon: 0.007143 Machine Gamma: 7.930212e-19
Machine Epsilon: 0.005000 Machine Gamma: 5.551115e-19
Experiment 2:
The following observations can be made:
1.Decreasing Epsilon Values: As the machine epsilon decreases, it indicates an
improvement in the precision of the floating-point representation. Smaller machine
epsilon values suggest that the system can represent smaller differences between
floating-point numbers.