Given a value S and an approximation S’ to it, theabsolute error is | S-S’ |.
The relative error is | (S-S’)/S |.
Run the “round-off error” program
x = 1.0/n
for k = 1 to M do {
x = x*(n+1.0) – 1.0
}
print, n, M, x
Run the program in both single precision (float) and in doubleprecision (double). As in the previous question, it may benecessary to create a variable one. The final value of xshould be 1/n. Note that n is stored as a floating point number.Make a table with rows indexed by n=5,6,7,8,9,10, and columns:initial x, final x, absolute error, relative error. Do
PayPal Gateway not configured
PayPal Gateway not configured