Skip to main content

Weibull Distribution

Name

UxHwDoubleWeibullDist, UxHwFloatWeibullDist Create a Weibull distribution.

Synopsis

#include <uxhw.h>

double UxHwDoubleWeibullDist(double k, double lambda);
float UxHwFloatWeibullDist(float k, float lambda);

Description

The UxHwDoubleWeibullDist() function, on architectures that associate distributional information with floating-point values, creates a Weibull distribution with parameters k and lambda and associates it with its return value. The particle return value is the mean value of a Weibull distribution with parameters k and lambda. The probability density function of the Weibull distribution is

f(x;λ,k)={kλ(xλ)k1e(x/λ)kx00x<0.f(x;\lambda,k)=\begin{cases} \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1}e^{-(x/\lambda)^k} & x\ge 0 \\ 0 & x < 0. \end{cases}

Parameters

  • k The scale parameter (k) of the Weibull distribution.
  • lambda The shape parameter (λ\lambda) of the Weibull distribution.

Return Values

The UxHwDoubleWeibullDist() function returns the mean of samples of a Weibull distribution with parameters k and lambda. If k <= 0 or l <= 0, the function returns NaN.

  Examples

#include <stdio.h>
#include <uxhw.h>

int
main(void)
{
double value = UxHwDoubleWeibullDist(1.0, 1.5);
printf("value = %lf\n", value);

return 0;
}