I assume that abs and fabs are behaving different when using math.h. But when I use just cmath and std::abs,
It's still okay to use fabs for double and float arguments. I prefer this because it ensures that if I accidentally strip the std:: off the abs, that the behavior remains the same for floating point inputs.
I just spent 10 minutes debugging this very problem, due to my own mistake of using abs instead of std::abs. I assumed that the using namespace std;would infer std::abs but it did not, and instead was using the C version.
Anyway, I believe it's good to use fabs instead of abs for floating-point inputs as a way of documenting your intention clearly.