Skip to main content

Exponential Distribution

Name​

UxHwDoubleExponentialDist, UxHwFloatExponentialDist — Create an Exponential distribution.

Synopsis​

#include <uxhw.h>

double UxHwDoubleExponentialDist(double mu);
float UxHwFloatExponentialDist(float mu);

Description​

The UxHwDoubleExponentialDist() function, on architectures that associate distributional information with floating-point values, creates an Exponential distribution with parameter mu and associates it with its return value. The particle return value is the mean value of an Exponential distribution with parameter mu. The probability density function of the Exponential distribution is

{1μe−x/μx≥0,0x<0.\begin{cases} \frac{1}{\mu}e^{-x/\mu} & x \ge 0, \\ 0 & x < 0. \end{cases}

Parameters​

  • mu — The scale parameter (μ\mu) of the Exponential distribution.

Return values​

The UxHwDoubleExponentialDist() function returns the mean of samples of a Exponential distribution with parameter mu. If mu < 0, the function returns NaN. If any parameter is NaN, the function returns -NaN. See Handling of NaN.

Examples​

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

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

return 0;
}