/* nag_jacobian_theta (s21ccc) Example Program. * * Copyright 2000 Numerical Algorithms Group. * * NAG C Library * * Mark 6, 2000. */ #include #include #include #include #include int main(int argc, char *argv[]) { FILE *fpin, *fpout; Integer exit_status = 0, k; NagError fail; double q, x, y; INIT_FAIL(fail); /* Check for command-line IO options */ fpin = nag_example_file_io(argc, argv, "-data", NULL); fpout = nag_example_file_io(argc, argv, "-results", NULL); /* Skip heading in data file */ fscanf(fpin, "%*[^\n] "); fprintf(fpout, "nag_jacobian_theta (s21ccc) Example Program Results\n"); fprintf(fpout, " k x q y\n"); while (fscanf(fpin, "%ld%lf%lf%*[^\n]", &k, &x, &q) != EOF) { /* nag_jacobian_theta (s21ccc). * Jacobian theta functions with real arguments */ y = nag_jacobian_theta(k, x, q, &fail); if (fail.code != NE_NOERROR) { fprintf(fpout, "Error from nag_jacobian_theta (s21ccc).\n%s\n", fail.message); exit_status = 1; goto END; } fprintf(fpout, "%2ld %4.1f %4.1f %13.4e\n", k, x, q, y); } END: if (fpin != stdin) fclose(fpin); if (fpout != stdout) fclose(fpout); return exit_status; }