Print infinite floats correctly

Fixes the optimizer producing invalid code for infinite float constants.