cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ] #include <mathcw.h> extern float eljagf (float u, float k, int /* nabc */, float aj[/* nabc */], float bj[/* nabc */], float cj[/* nabc */], float phij[/* nabc */], int *pneed); extern double eljag (double u, double k, int /* nabc */, double aj[/* nabc */], double bj[/* nabc */], double cj[/* nabc */], double phij[/* nabc */], int *pneed); extern long double eljagl (long double u, long double k, int /* nabc */, long double aj[/* nabc */], long double bj[/* nabc */], long double cj[/* nabc */], long double phij[/* nabc */], int *pneed); extern __float80 eljagw (__float80 u, __float80 k, int /* nabc */, __float80 aj[/* nabc */], __float80 bj[/* nabc */], __float80 cj[/* nabc */], __float80 phij[/* nabc */], int *pneed); extern __float128 eljagq (__float128 u, __float128 k, int /* nabc */, __float128 aj[/* nabc */], __float128 bj[/* nabc */], __float128 cj[/* nabc */], __float128 phij[/* nabc */], int *pneed); extern long_long_double eljagll (long_long_double u, long_long_double k, int /* nabc */, long_long_double aj[/* nabc */], long_long_double bj[/* nabc */], long_long_double cj[/* nabc */], long_long_double phij[/* nabc */], int *pneed); extern decimal_float eljagdf (decimal_float u, decimal_float k, int /* nabc */, decimal_float aj[/* nabc */], decimal_float bj[/* nabc */], decimal_float cj[/* nabc */], decimal_float phij[/* nabc */], int *pneed); extern decimal_double eljagd (decimal_double u, decimal_double k, int /* nabc */, decimal_double aj[/* nabc */], decimal_double bj[/* nabc */], decimal_double cj[/* nabc */], decimal_double phij[/* nabc */], int *pneed); extern decimal_long_double eljagdl (decimal_long_double u, decimal_long_double k, int /* nabc */, decimal_long_double aj[/* nabc */], decimal_long_double bj[/* nabc */], decimal_long_double cj[/* nabc */], decimal_long_double phij[/* nabc */], int *pneed); extern decimal_long_long_double eljagdll (decimal_long_long_double u, decimal_long_long_double k, int /* nabc */, decimal_long_long_double aj[/* nabc */], decimal_long_long_double bj[/* nabc */], decimal_long_long_double cj[/* nabc */], decimal_long_long_double phij[/* nabc */], int *pneed);
NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.
The argument u is unrestricted, but k is required to be in [-1,+1].
If pneed is not NULL, set the integer to which it points to the number of elements set, or needed, in the four arrays.
On return, if nset > nabc, then there was insufficient space in the arrays to compute the results.
Because the AGM algorithm is quadratically convergent, the number of elements needed in each array is small: 25 elements should suffice for precisions up to 70 decimal digits.
See M. Abramowitz & I. A. Stegun, Handbook of Mathematical Functions, Chapter 16, for definitions of the Jacobian elliptic, theta, and zeta functions.