The BETA routine returns the value of the Euler beta function B(Z, W). The Euler beta function is defined as: for This routine is written in the IDL language. Its source code can be found in the file beta.pro in the lib subdirectory of the IDL distribution.

## Examples

To evaluate the beta function at the point (1.0, 1.1) and print the result:

`PRINT, BETA(1.0, 1.1)`

IDL prints:

`0.909091`

The exact solution is:

((1.00 * .95135077) / (1.10 * .95135077)) = 0.909091

## Syntax

Result = BETA( Z, W [, /DOUBLE] )

## Return Value

If both arguments are scalar, the function returns a scalar. If both arguments are arrays, the function matches up the corresponding elements of Z and W, returning an array with the same dimensions as the smallest array. If one argument is a scalar and the other argument is an array, the function uses the scalar value with each element of the array, and returns an array with the same dimensions as the input array.

If both of the arguments are double-precision or if the DOUBLE keyword is set, the result is double-precision, otherwise the result is single-precision.

## Arguments

### Z, W

The point at which the beta function is to be evaluated. Z and W can be scalar or array. Z or W may be complex.

## Keywords

### DOUBLE

Set this keyword to force the computation to be done in double-precision arithmetic.

### Thread Pool Keywords

This routine is written to make use of IDL’s thread pool, which can increase execution speed on systems with multiple CPUs. The values stored in the !CPU system variable control whether IDL uses the thread pool for a given computation. In addition, you can use the thread pool keywords TPOOL_MAX_ELTS, TPOOL_MIN_ELTS, and TPOOL_NOTHREAD to override the defaults established by !CPU for a single invocation of this routine. See Thread Pool Keywords for details.

## Version History

 4.0.1 Introduced 5.6 Added Z and W arguments to accept complex input

## Resources and References

For more information on the Euler beta function, see Wikipedia.org's entry on the BETA function.