double fabs(double &num) { return num > 0.0 ? num : -num; }