Some systems have issues with fma in libm, so roll our own version.