fabsf has prototype float fabsf(float), but you use it with double. You can replace it with fabs()