Recursively find the second derivative
问题 I'm attempting to write a program in C which finds the numeric value of the second derivative of f(x) where x is given. When I use my function to find the first derivative, everything seems to be working okay, but the recursive second derivative part always gives me 0.0. Here's my function: double derivative(double (*f)(double), double x0, int order) { if(order == 1){ const double delta = 1.0e-6; double x1 = x0-delta; double x2 = x0+delta; double y1 = f(x1); double y2 = f(x2); return (y2 - y1