The following test case fails.
#include <math.h>
#include <float.h>
#include <stdlib.h>
int main()
{
float i = INFINITY;
float m = FLT_MAX;
if (nextafterf(m, i) != i)
abort ();
return 0;
}
This is because
if(hy>=0x7f800000) return x+x; /* overflow */
does not in fact overflow on x86; it gets computed with
long double precision.
r~