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

Machine epsilon Em is a characteristic of the CPU in one\'s computer. This machi

ID: 3887329 • Letter: M

Question

Machine epsilon Em 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 &m; is the smallest number such that 1 + > 1 . For any smaller value ofe round-off error will return a value of 1 + = 1 . Machine epsilon is defined by the formula ,-bi-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 n is the total number of digits in the mantissa (adjustable and fixed). Note: 1-m is the power of the base b because the first bit in a mantissa is fixed (more on this in Task 6). The fixed bit does not appear explicitly in the bit array representing a floating-point number The following is a convergent series: 28 38 48 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 Em. What would happen if one attempted to set the convergence criterion to exactly machine epsilon? Why? Call this script file a2task3.m and include it n your zip archive.

Explanation / Answer

for i = 1:64 %this loop tries to find epsilon form the defination given
    if (1 + 2^(-i)) == 1 %epsilon found
        esp = 2^(-i + 1) ;
        break;
    end      
end

sum = 0;
i = 1;
condition = true
while condition
    sum = sum + 1/i^8
    i = i + 1
    abs(sum -(pi^8/9450))
    condition = abs(sum -(pi^8/9450)) > esp*100;
end

fprintf('%d terms required', i)

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

If we try to converge difference to epsilon, we shall trap ourself into an infinite loop, because changes would not reflect once the differnce is less than epsilon. so it is always safe to keep distance from epsilon

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