public double Derivative(double x) { #if DEBUG if (x < 0) throw new Exception(); #endif return -0.5 * Math.Exp(-0.5 * x); } }