/* nag_prob_landau (g01etc) Example Program. * * Copyright 2002 Numerical Algorithms Group. * * Mark 7, 2002. */ #include #include #include #include #include int main(int argc, char *argv[]) { FILE *fpin, *fpout; /* Scalars */ double x, y; Integer exit_status = 0; /* Check for command-line IO options */ fpin = nag_example_file_io(argc, argv, "-data", NULL); fpout = nag_example_file_io(argc, argv, "-results", NULL); fprintf(fpout, " nag_prob_landau (g01etc) Example Program Results\n"); /* Skip heading in data file */ fscanf(fpin, "%*[^\n] "); fscanf(fpin, "%lf%*[^\n] ", &x); /* nag_prob_landau (g01etc). * Landau distribution function Phi(lambda~) */ y = nag_prob_landau(x); fprintf(fpout, "\n X Y\n\n"); fprintf(fpout, " %3.1f %13.4e\n", x, y); if (fpin != stdin) fclose(fpin); if (fpout != stdout) fclose(fpout); return exit_status; }