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