Math problem: Underflow and gradual underflow

261 Views Asked by At

My book has the following question but doesn't come with an answer key; I was hoping someone could verify my work and/or help me understand this. Just to clarify, this is not homework (though I appreciate that you have no way of knowing that):

Assume a normalized floating point system with $\beta=10$, $p = 3$, and $L = -98$.

(a) What is the value of the underflow level (UFL) for this system?

(b) If $x = 6.87 \times 10^{-97}$ and $y = 6.81 \times 10^{-97}$, what is the result of $x - y$?

(c) What would be the result of $x - y$ if the system permitted gradual underflow?

Part (a)

Okay, so just to clarify:

  • $\beta$ is the base of our floating-point system (in this case, $10$)

  • $p$ is the precision (the number of digits allowed in the mantissa)

  • $L$ is the lowest value that the exponent could assume

The book defines the underflow level to simply be the smallest positive number we can represent: $\beta^{L}$.

My answer is $10^{-98}$.

Part (b)

For this one, I get $0.06 \times 10^{-97}$, but since we have to normalize the system, that's $6 \times 10^{-2} \times 10^{-97} = 6 \times 10^{-99}$.

The book says any number lower than the underflow level cannot be represented. So, would the answer just be the underflow level itself as the closest possible approximation? Or would it just be the number $0$?

Part (c)

The book defines gradual underflow as any floating-point system that "relaxes" its insistence that numbers be in normalized form. In other words, we allow the mantissa to have a leading digit other than one so that it can take on greater exponents.

So would the answer be $0.06 \times 10^{-99}$ as I computed before, or is there a catch here?

Edit: I meant to say "So would the answer be $6 \times 10^{-99}$..."

1

There are 1 best solutions below

1
On BEST ANSWER

If you require that the leading digit of the mantissa be at least $1$ your answer for a is correct. The smallest positive number you can represent is $1.00\cdot 10^{-98}$. I would express it that way rather than just $10^{98}$ because I think it is clearer where it comes from and how much precision it has.

For b the result of the subtraction would be $0.06\cdot 10^{-97}$. Since this can not be normalized, it would either round down to $0$ or up to $1.00\cdot 10^{-98}$. I don't think you have specified the behavior well enough for us to determine which will happen.

For c, if gradual underflow is permitted the result should be $0.60\cdot 10^{-98}$ or $0.06 \cdot 10^{-97}$