Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Machine epsilon epsilon_m is a characteristic of the CPU in one\'s computer. Thi

ID: 2247916 • Letter: M

Question

Machine epsilon epsilon_m is a characteristic of the CPU in one's computer. This machine constant is used extensively when writing computer code to help make one's algorithms CPU insensitive. Machine epsilon epsilon_m is the smallest number epsilon such that l + epsilon > 1. For any smaller value of epsilon round-off error will return a value of l + epsilon = 1, Machine epsilon is defined by the formula epsilon_m = b^1 - m where b is the base number used by your computer in its construction of a floating-point number (b = 2 in computers that run Intel chips), and m is the total number of digits in the mantissa (adjustable and fixed). The following is a convergent series: 1 + 1/2^8 + 1/3^8 + 1/4^8 + .. = pi^8/9450 Write a MatLab script file that reports to the command window the minimum number of terms in this series (including 1) needed to obtain its solution, accurate to within 100 times machine precision epsilon_m. What would happen if one attempted to set the convergence criterion to exactly machine epsilon? Why?

Explanation / Answer

Machine epsilon, mach is defined as the smallest number such that 1+ mach > 1 . It is the difference between 1 and the next nearest number representable as a machine number. Let’s look at this concept for a hypothetical word of 8 bits that stores a real number where the first bit is used for the sign of the number, the next three bits for the biased exponent, and the last four bits for the magnitude of the mantissa

The following code was used to determine the machine epsilon for single and double precision numbers:

% EPS Spacing of floating point numbers.

%   D = EPS(X), is the positive distance from ABS(X) to the next larger in

%   magnitude floating point number of the same precision as X.

%   X may be either double precision or single precision.

%   For all X, EPS(X) is equal to EPS(ABS(X)).

% EPS, with no arguments, is the distance from 1.0 to the next larger double

%   precision number, that is EPS with no arguments returns 2^(-52).

%    EPS('double') is the same as EPS, or EPS(1.0).

%   EPS('single') is the same as EPS(single(1.0)), or single(2^-23).

% Except for numbers whose absolute value is smaller than REALMIN,

%   if 2^E <= ABS(X) < 2^(E+1), then

%      EPS(X) returns 2^(E-23) if ISA(X,'single')

%      EPS(X) returns 2^(E-52) if ISA(X,'double')

%   For all X of class double such that ABS(X) <= REALMIN, EPS(X)

%   returns 2^(-1074).   Similarly, for all X of class single such that

%   ABS(X) <= REALMIN('single'), EPS(X) returns 2^(-149).

%   Replace expressions of the form

%      if Y < EPS * ABS(X)

%  

        With

%      if Y < EPS(X)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote