private static double Sign(double a, double b) { return (b >= 0.0) ? System.Math.Abs(a) : -System.Math.Abs(a); }