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

Function dlnorm_1

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

Source from the content-addressed store, hash-verified

45}
46
47inline double dlnorm_1(double x, double meanlog, int log_p){
48 double y;
49
50#ifdef IEEE_754
51 if (ISNAN(x) || ISNAN(meanlog))
52 return x + meanlog + 1.0;
53#endif
54
55 if (x <= 0) return R_D__0;
56
57 y = (::log(x) - meanlog);
58 return (log_p ?
59 -(M_LN_SQRT_2PI + 0.5 * y * y + ::log(x)) :
60 M_1_SQRT_2PI * ::exp(-0.5 * y * y) / x);
61 /* M_1_SQRT_2PI = 1 / sqrt(2 * pi) */
62
63}
64
65inline double plnorm_0(double x, int lower_tail, int log_p){
66#ifdef IEEE_754

Callers

nothing calls this directly

Calls 2

logFunction · 0.50
expFunction · 0.50

Tested by

no test coverage detected