libm is now somewhat integrated with gcc's -ffinite-math-only option and lots of the wrapper functions have been optimized. Backport of commit #0ac5ae23