cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ] #include <mathcw.h> extern float ellrcf (float x, float y); extern double ellrc (double x, double y); extern long double ellrcl (long double x, long double y); extern __float80 ellrcw (__float80 x, __float80 y); extern __float128 ellrcq (__float128 x, __float128 y); extern long_long_double ellrcll (long_long_double x, long_long_double y); extern decimal_float ellrcdf (decimal_float x, decimal_float y); extern decimal_double ellrcd (decimal_double x, decimal_double y); extern decimal_long_double ellrcdl (decimal_long_double x, decimal_long_double y); extern decimal_long_long_double ellrcdll (decimal_long_long_double x, decimal_long_long_double y);
NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.
where x >= 0 and y > 0.ellrc(x, y) = R(1/2; 1/2, 1; x, y) = (1/2) * integral(t=0:Infinity) (t + x)**(-1/2) * (t + y)**(-1) dt = ellrf(x, y, y)
The normalization condition satisfied is
This integral is related to several elementary functions:ellrc(x, x) = x**(-1/2).
acos(x) = sqrt((1 - x) * (1 + x)) * ellrc(x * x, 1) acosh(x) = sqrt((x - 1) * (x + 1)) * ellrc(x * x, 1) acot(x) = ellrc(x * x, x * x + 1) acoth(x) = ellrc(x * x, x * x - 1) asin(x) = x * ellrc((1 - x) * (1 + x), 1) asinh(x) = x * ellrc(1 + x * x, 1) atan(x) = x * ellrc(1, 1 + x * x) atanh(x) = x * ellrc(1, (1 - x) * (1 + x)) log(x) = (x - 1) * ellrc((1 + x)**2 / 4, x) log1p(x) = x * ellrc((2 + x)**2 / 4, 1 + x)
This computational route is not as fast as the algorithms used in the conventional elementary-function implementations, and for some of them, has a more limited floating-point range because of the argument squares. Nevertheless, it is stable and accurate, and provides a convenient check between radically-different algorithms.