/* nag_polygamma_deriv (s14adc) Example Program. * * Copyright 2002 Numerical Algorithms Group. * * Mark 7, 2002. */ #include #include #include #include int main(void) { double x, w[4]; int n, m; /* Skip heading in data file */ Vscanf("%*[^\n]"); Vprintf("nag_polygamma_deriv (s14adc) Example Program Results\n"); Vprintf(" x w(0,x) w(1,x) w(2,x) w(3,x)\n"); while (scanf("%lf", &x) != EOF) { n = 0; m = 4; /* nag_polygamma_deriv (s14adc). * Scaled derivatives of psi(x) */ nag_polygamma_deriv(x, n, m, w, NAGERR_DEFAULT); Vprintf("%12.4e %12.4e %12.4e %12.4e %12.4e\n", x, w[0], w[1], w[2], w[3]); } return EXIT_SUCCESS; }