Reverted to fmax using tgmath.h to handle 64-bit builds.