Question

In: Computer Science

Two numbers x and y that are not machine numbers are read into a 32-bit word-length...

Two numbers x and y that are not machine numbers are read into a 32-bit word-length computer. The machine computes to xy2. what sort of relative error can be expected? Assume no underflow or overflow

Solutions

Expert Solution

For Integer values

If numbers x and y are integers then there will be no relative error because computer need not round off or chop the integers for any arithmetic operation, unless underflow or overflow, which according to the question need not be considered.

For floating-point values

We have word length of 32 bits where as much as possible of the normalized floating-point number ±q × 2m must be contained in these 32 bits. Let us take allocation as follows:

sign of q 1 bit
sign of m 1 bit
|m| 6 bits
q 24 bits

Calculating relative unit bound error:

Consider a positive number in normalized floating-point for,

x = ±q × 2m, 0.5 ≤ q < 1, |m| ≤ 26 − 1 = 63

Replacing x by its nearest machine number, denoted by fl(x), is a process known as rounding and the error involved is known as round-off error. Writing x in normalized binary notation

x = (0.1a2a3 · · · a20a21a22 · · ·)2 × 2m

the nearest machine number to the left of x (rounding down) on the real number line

xL = (0.1a2a3 · · · a24)2 × 2m

while the nearest machine number to the right of x (rounding up) is

xR = [(0.1a2a3 · · · a24)2 + 2−24] × 2m

The closer of these machine numbers is the one chosen to represent x. If x lies closer to xL than xR, then,

|x − xL| ≤ 0.5 * |xR − xL| = 2−25+m

so that the relative error bound is calculated as

|x − xL| / |x| ≤ (2−25+m / (0.1a2a3 · · ·)2 × 2m) ≤ 2−25 / 2 = 2−24

=>Relative unit error bound will be 2-24 for our machine.

Now consider xy2

For our allocation, we have 6 bits for the representation of 'm', thus 6 digits normalised floating-point number. As a result, x*y*y will have 18 normalised digits which give a relative error of 18*(2-24).


Related Solutions

Translate these two LEGv8 assembly instructions to 32-bit binary machine code. Give your answer in hexadecimal....
Translate these two LEGv8 assembly instructions to 32-bit binary machine code. Give your answer in hexadecimal. CBZ X19, exit ADD X10, X19, X20 exit:
Suppose P (x, y) means “ x and y are real numbers such that x +...
Suppose P (x, y) means “ x and y are real numbers such that x + 2y = 5 .” Determine whether the statement is true for ∀x∃yP(x,y) and ∃x∀yP(x,y)
Develop a recursive algorithm that multiply two integer numbers x and y, where x is an...
Develop a recursive algorithm that multiply two integer numbers x and y, where x is an m-bit number and y is an n-bit number (10 points), and analyze the time complexity of this algorithm (10 points).
Consider the following data for two variables, x and y. x 9 32 18 15 26...
Consider the following data for two variables, x and y. x 9 32 18 15 26 y 10 19 22 17 23 (a) Develop an estimated regression equation for the data of the form ŷ = b0 + b1x. (Round b0 to two decimal places and b1 to three decimal places.) ŷ = Comment on the adequacy of this equation for predicting y. (Use α = 0.05.) The high p-value and low coefficient of determination indicate that the equation is...
Consider the following data for two variables, x and y. x 9 32 18 15 26...
Consider the following data for two variables, x and y. x 9 32 18 15 26 y 10 19 21 17 23 (a)Develop an estimated regression equation for the data of the form ŷ = b0 + b1x. (Round b0 to two decimal places and b1 to three decimal places.) ŷ =____ (b)Develop an estimated regression equation for the data of the form ŷ = b0 + b1x + b2x2. (Round b0 to two decimal places and b1 to three...
Consider the following data for two variables, x and y. x 9 32 18 15 26...
Consider the following data for two variables, x and y. x 9 32 18 15 26 y 9 19 21 17 22 (a) Develop an estimated regression equation for the data of the form  ŷ = b0 + b1x. (Round b0 to two decimal places and b1 to three decimal places.) ŷ =   Comment on the adequacy of this equation for predicting y. (Use α = 0.05.) The high p-value and low coefficient of determination indicate that the equation is inadequate...
1) Consider the following data for two variables, x and y. x 9 32 18 15...
1) Consider the following data for two variables, x and y. x 9 32 18 15 26 y 10 20 21 17 21 (a) Develop an estimated regression equation for the data of the form ŷ = b0 + b1x. (Round b0 to two decimal places and b1 to three decimal places.)  ŷ =   2) A statistical program is recommended. A study investigated the relationship between audit delay (Delay), the length of time from a company's fiscal year-end to the date...
What two positive real numbers x and y, with xy=12, minimize 3x+y?
What two positive real numbers x and y, with xy=12, minimize 3x+y?
c) Using the 32-bit binary representation for floating point numbers, represent the number 1011100110011 as a...
c) Using the 32-bit binary representation for floating point numbers, represent the number 1011100110011 as a 32 bit floating point number. i) A digital camera processes the images images in the real-world and stores them in binary form. Using the principles of digital signal processing, practically explain how this phenomenon occurs.
Assume that a floating-point number system has base 2, word length 32 bits, mantissa length 24...
Assume that a floating-point number system has base 2, word length 32 bits, mantissa length 24 bits, and does rounding. Assume also that the first bit is implicit. Represent the numbers 1/2, 2/3 and 3/5 as floating-point numbers in this system. (Hint: For less confusion, you might want to write out all 25 binary digits.) Could you please me give me full procedure?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT