Chapter 15: Utilities > beta

beta

Evaluates the complete beta function.

Synopsis

#include <imsls.h>

float imsls_f_beta (float a, float b)

The type double procedure is imsls_d_beta.

Required Arguments

float a   (Input)
First beta parameter. It must be positive.

float b   (Input)
Second beta parameter. It must be positive.

Return Value

The value of the beta function β(ab). If no result can be computed, then NaN is returned.

Description

The beta function, β(ab), is defined to be

Example

Evaluate the beta function β(0.5, 0.2).

#include <imsls.h>

 

int main()

{

    float       x = 0.5;

    float       y = 0.2;

    float       ans;

 

    ans = imsls_f_beta(x, y);

    printf("beta(%f,%f) = %f\n", x, y, ans);

}

Output

beta(0.500000,0.200000) = 6.268653

Figure 15- 1  Plot of β (xb)

The beta function requires that a > 0 and b > 0. It underflows for large arguments.

Alert Errors

IMSLS_BETA_UNDERFLOW                         The arguments must not be so large that the result underflows.

Fatal Errors

IMSLS_ZERO_ARG_OVERFLOW                  One of the arguments is so close to zero that the result overflows.


RW_logo.jpg
Contact Support