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

Function pweibull_1

inst/include/Rcpp/stats/weibull.h:49–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 shape * tmp1 * ::exp(-tmp2);
48}
49inline double pweibull_1(double x, double shape /*, double scale [=1.0] */, int lower_tail, int log_p) {
50#ifdef IEEE_754
51 if (ISNAN(x) || ISNAN(shape))
52 return x + shape + 1.0;
53#endif
54 if (shape <= 0) return R_NaN;
55
56 if (x <= 0)
57 return R_DT_0;
58 x = -::pow(x , shape);
59 if (lower_tail)
60 return (log_p
61 /* log(1 - exp(x)) for x < 0 : */
62 ? (x > -M_LN2 ? ::log(-::expm1(x)) : ::log1p(-::exp(x)))
63 : -::expm1(x));
64 /* else: !lower_tail */
65 return R_D_exp(x);
66}
67inline double qweibull_1(double p, double shape /*, double scale [=1.0] */, int lower_tail, int log_p){
68#ifdef IEEE_754
69 if (ISNAN(p) || ISNAN(shape))

Callers

nothing calls this directly

Calls 3

powFunction · 0.85
logFunction · 0.50
expFunction · 0.50

Tested by

no test coverage detected