/* nag_prob_beta_dist(g01eec) Example Program * * Copyright 1990 Numerical Algorithms Group. * * Mark 1 1990. */ #include #include #include #include int main(void) { double a, b, p, pdf, q, tol, x; static NagError fail; /* Skip heading in data file */ Vscanf("%*[^\n]"); Vprintf("g01eec Example Program Results\n"); Vprintf(" x a b p q" " pdf\n\n"); while (scanf("%lf %lf %lf %lf", &x, &a, &b, &tol) != EOF) { g01eec(x, a, b, tol, &p, &q, &pdf, &fail); if (fail.code==NE_NOERROR) Vprintf("%7.4f%13.4e%13.4e%13.4e%13.4e%13.4e\n", x, a, b, p, q, pdf); else { Vprintf("%7.4f%13.4e%13.4e%13.4e%13.4e%13.4e\n Note: %s\n",x,a, b, p, q, pdf, fail.message); return EXIT_FAILURE; } } return EXIT_SUCCESS; }