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

f(x;μ)={1μex/μx00x<0.f(x;\mu)=\begin{cases} \frac{1}{\mu}e^{-x/\mu} & x\ge 0 \\ 0 & x < 0. \end{cases}

Parameters

  • mu The 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.

  Examples

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

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

return 0;
}