public static double SubtractLog(double a, double b) { double r = Math.Log((1.0 + a) / (1.0 + b)); if (double.IsNaN(r)) { throw new Exception("Filter: SubtractLog = NaN"); } return r; }