Replaced abs by fabs for operations on doubles.