/* nag_jacobian_elliptic (s21cbc) Example Program. * * Copyright 2000 Numerical Algorithms Group. * * NAG C Library * * Mark 6, 2000. */ #include #include #include #include int main(void) { Complex cn, dn, sn, z; Integer exit_status=0; NagError fail; double ak2; INIT_FAIL(fail); /* Skip heading in data file */ Vscanf("%*[^\n] "); Vprintf("nag_jacobian_elliptic (s21cbc) Example Program Results\n"); while (scanf(" (%lf,%lf) %lf%*[^\n] ", &z.re, &z.im, &ak2) != EOF) { /* nag_jacobian_elliptic (s21cbc). * Jacobian elliptic functions sn, cn and dn of complex * argument */ nag_jacobian_elliptic(z, ak2, &sn, &cn, &dn, &fail); Vprintf(" z ak2\n"); Vprintf(" (%8.4f,%8.4f) %10.2f\n\n", z.re, z.im, ak2); if (fail.code == NE_NOERROR) { Vprintf(" sn cn dn" "\n"); Vprintf(" (%8.4f,%8.4f) ", sn.re, sn.im); Vprintf("(%8.4f,%8.4f) ", cn.re, cn.im); Vprintf("(%8.4f,%8.4f)", dn.re, dn.im); Vprintf("\n"); } else { Vprintf("Error from nag_jacobian_elliptic (s21cbc).\n%s\n", fail.message); exit_status = 1; goto END; } } END: return exit_status; }