/* nag_polygamma_fun (s14acc) Example Program. * * Copyright 2002 Numerical Algorithms Group. * * Mark 7, 2002. */ #include #include #include #include int main(void) { double f, x; /* Skip heading in data file */ Vscanf("%*[^\n]"); Vprintf("nag_polygamma_fun (s14acc) Example Program Results\n"); Vprintf(" x psi(x)-log(x)\n"); while (scanf("%lf", &x) != EOF) { /* nag_polygamma_fun (s14acc). * psi(x)~-~ln~x */ f = nag_polygamma_fun(x, NAGERR_DEFAULT); Vprintf("%8.3f %14.4f\n", x, f); } return EXIT_SUCCESS; }