cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ] #include <mathcw.h> extern float betaf (float); extern double beta (double); extern long double betal (long double); extern __float80 betaw (__float80); extern __float128 betaq (__float128); extern long_long_double betall (long_long_double); extern decimal_float betadf (decimal_float); extern decimal_double betad (decimal_double); extern decimal_long_double betadl (decimal_long_double); extern decimal_long_long_double betadll (decimal_long_long_double);
NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.
These values are defined by the relations
beta(x) = sum(k = 1:Infinity) (-1)**k (2k - 1)**(-x).
Some special values of the beta function are
Here, k is a positive nonzero integer, and E[2k] is an Euler number (see eulnum(3CW)).beta(-2k) = (1/2) E[2k] beta(-2k - 1) = 0 beta(0) = -1/2 beta(1) = +pi/4 beta(2) = 0.915965594177219015054603... beta(3) = pi**2 / 32 beta(2k + 1) = (pi/2)**(2k + 1) |E[2k]| / (2 * (2k)!)
Although the beta function of odd positive integer arguments has a simple closed form in terms of pi and Euler numbers, no simple formulas are known for the case of even positive integer arguments.
The number beta(2) is known as Catalan's constant.
Whole-number arguments are special cases that are computed internally, and quickly, by a call to betnum(3CW).
For large positive x, the value of beta(x) approaches 1 from below, so the companion function betam1(x) should then be used to compute the difference beta(x) - 1 accurately.
If the argument is -Infinity, set errno to ERANGE and return +Infinity.