Beta Distribution
Name
UxHwDoubleBetaDist, UxHwFloatBetaDist — Create a Beta distribution.
Synopsis
#include <uxhw.h>
double UxHwDoubleBetaDist(double a, double b);
float UxHwFloatBetaDist(float a, float b);
Description
The UxHwDoubleBetaDist() function, on architectures that associate distributional information with floating-point values, creates a Beta distribution with parameters a and b and associates it with its return value. The particle return value is the mean value of a Beta distribution with parameters a and b. The probability density function of the Beta distribution is
where is the Beta function and is the Gamma function.
Parameters
a— The shape parameter () of the Beta distribution.b— The shape parameter () of the Beta distribution.
Return values
The UxHwDoubleBetaDist() function returns the mean value of a Beta distribution with parameters a and b and associates it with a Beta distribution with parameters a and b.
Illegal parameter values
If a <= 0 or b <= 0, the function returns NaN.
If a or b is NaN or INFINITY, the function returns -NaN. See Handling of NaN.
Examples
#include <stdio.h>
#include <uxhw.h>
int
main(void)
{
double value = UxHwDoubleBetaDist(1.0,2.0);
printf("value = %lf\n", value);
return 0;
}