You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
811 B

--- a/src/pdfs.c
+++ b/src/pdfs.c
@@ -80,7 +80,7 @@ float box_muller(void) {
fprintf(stderr, "pdf box_muller() rand() error\n");
return 0;
} else {
- w = sqrt( (-2.0 * log( w ) ) / w );
+ w = sqrt( (-2.0 * logf( w ) ) / w );
y1 = x1 * w;
y2 = x2 * w;
}
@@ -93,8 +93,8 @@ float normal(float mean, float variance)
}
float lognormal(float mu, float sigma) {
- float phi = sqrt((mu * mu) + (sigma * sigma));
- float mu_prime = log(((mu * mu)/phi));
- float sigma_prime = sqrt(log((phi * phi)/(mu * mu)));
- return (exp(normal(mu_prime,sigma_prime)));
+ float phi = sqrtf((mu * mu) + (sigma * sigma));
+ float mu_prime = logf(((mu * mu)/phi));
+ float sigma_prime = sqrtf(logf((phi * phi)/(mu * mu)));
+ return (expf(normal(mu_prime,sigma_prime)));
}