Laplace Distribution
Name
UxHwDoubleLaplaceDist, UxHwFloatLaplaceDist — Create a Laplace distribution.
Synopsis
#include <uxhw.h>
double UxHwDoubleLaplaceDist(double mu, double b);
float UxHwFloatLaplaceDist(float mu, float b);
Description
The UxHwDoubleLaplaceDist() function, on architectures that associate distributional information with floating-point values, creates a Laplace distribution with parameters mu and b and associates it with its return value. The particle return value is the mean value of a Laplace distribution with parameters mu and b. The probability density function of the Laplace distribution is
Parameters
mu— The location parameter () of the Laplace distribution.b— The scale parameter (b) of the Laplace distribution.
Return Values
The UxHwDoubleLaplaceDist() function returns the mean of samples of a Laplace distribution with parameters mu and b.
If b < 0, the function returns NaN.
✏️ Examples
#include <stdio.h>
#include <uxhw.h>
int
main(void)
{
double value = UxHwDoubleLaplaceDist(0.0, 1.0);
printf("value = %lf\n", value);
return 0;
}