Gradual Underflow

Suppose the smallest positive value we can represent as a floating point number is 001e-55, and the mantissa always has three digits. One problem with underflow -- besides that it happens at all -- is that while sometimes the difference between 020e-55 and 019e-55 is unimportant (only 5%), the the difference between 002e-55 and 001e-55 is dramatic (50%), and even worse going from 001e-55 and 000e-55 is a 100% change. That is, the underflow occurs "suddenly".

Consider the following process of putting music onto a CD: every short fraction of a second, the volume of the music is sampled and stored as a floating-point number. As the song fades out, going from 020e-55 to 019e-55 isn't particular important to the human ear. However, as 002e-55 changes to 001e-55, it is noticeable to the human ear, and as the final lingering note finally fades even fainter, the number stored on the cd changes abruptly from 001e-55 to 0.

I'm not a picky audiophile, and don't claim to be able to hear differences in digital versus analog recordings when the music is at all loud. But I do have several CD's (mostly classical) on which, as I wear headphones and the music fades fades fades fades, even my ear hears the sudden, sharp steps from "quiet" to "50% quiet" to "100% quiet". (CDs encode volume level by integers, not floats, but the cause of the problem is the same.)

What would be desired is that as we're about to underflow, we postpone the problem by going from 001e-55 to 10e-56, where we are able to put 56 into the exponent -- exceeding the 55 barrier -- by only using two significant digits in the mantissa and giving up more space to the exponent. This is what gradual underflow is.

If it's so great, why isn't it always used? Because there is a price to pay: every floating point number needs to keep an extra bit of information around, telling if its sequence of digits should be interpreted 'normally' or in 'gradual underflow' mode. (Internally, the number is just a sequence of digits, without a letter "e".) Also, all code which does arithmetic needs to take extra time to check that bit of information on every number it processes.

On CDs, gradual underflow certainly should have been used; fortunately, in anything you engineer, you'll remember to think of this artifact, and decide whether gradual underflow is useful for your purpose.