/* nag_prob_density_vavilov (g01muc) Example Program. * * Copyright 2002 Numerical Algorithms Group. * * Mark 7, 2002. */ #include #include #include #include #include int main(void) { /* Scalars */ double c1, c2, x, rkappa, beta2, xl, xu, y; Integer exit_status, mode; NagError fail; #define WKMAX 322 double comm_arr[WKMAX]; mode = 0; INIT_FAIL(fail); exit_status = 0; c1 = -X02ALC; c2 = -X02ALC; Vprintf(" g01muc Example Program Results\n\n"); /* Skip heading in data file */ Vscanf("%*[^\n] "); while (scanf("%lf%lf%lf%*[^\n] ", &x, &rkappa, &beta2) != EOF) { if ((rkappa != c1) || (beta2 != c2 )) { g01zuc(rkappa, beta2, mode, &xl, &xu, comm_arr, &fail); if (fail.code != NE_NOERROR) { Vprintf("Error from g01zuc.\n%s\n", fail.message); exit_status = 1; goto END; } } y = g01muc(x, comm_arr); Vprintf(" X Rkappa Beta2 Y\n\n"); Vprintf(" %3.1f %3.1f %3.1f %12.4e\n", x, rkappa, beta2, y); c1 = rkappa; c2 = beta2; } END: return exit_status; }