The finite() function has been superseded by isfinite(). There is also
no need to use scalb(), as the exponent is also an integer value. We can
simply use scalbn().
There is also no need to use __isnanf(). The values passed are
guaranteed to be of type float, meaning we can safely use the standard
isnan().