MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / dlnorm_0

Function dlnorm_0

inst/include/Rcpp/stats/lnorm.h:30–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace stats {
29
30inline double dlnorm_0(double x, int log_p){
31 double y;
32
33#ifdef IEEE_754
34 if (ISNAN(x))
35 return x + 1.0;
36#endif
37
38 if (x <= 0) return R_D__0;
39
40 y = ::log(x);
41 return (log_p ?
42 -(M_LN_SQRT_2PI + 0.5 * y * y + ::log(x)) :
43 M_1_SQRT_2PI * ::exp(-0.5 * y * y) / x);
44 /* M_1_SQRT_2PI = 1 / sqrt(2 * pi) */
45}
46
47inline double dlnorm_1(double x, double meanlog, int log_p){
48 double y;

Callers

nothing calls this directly

Calls 2

logFunction · 0.50
expFunction · 0.50

Tested by

no test coverage detected