private double function(double[] input) { double a = 0.5 * input.DotAndDot(Q, input); double b = input.Dot(d); return a + b + c; }