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

Function pnorm_0

inst/include/Rcpp/stats/norm.h:78–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78inline double pnorm_0(double x /*, double mu [=0.] , double sigma [=1.]*/ , int lower_tail, int log_p) {
79 double p, cp;
80
81 /* Note: The structure of these checks has been carefully thought through.
82 * For example, if x == mu and sigma == 0, we get the correct answer 1.
83 */
84#ifdef IEEE_754
85 if (ISNAN(x))
86 return x + 1.0;
87#endif
88 p = x;
89 if (!R_FINITE(p))
90 return (x < 0.0) ? R_DT_0 : R_DT_1;
91 x = p;
92
93 ::Rf_pnorm_both(x, &p, &cp, (lower_tail ? 0 : 1), log_p);
94
95 return(lower_tail ? p : cp);
96}
97
98inline double qnorm_1(double p, double mu /*, double sigma [=1.] */,
99 int lower_tail, int log_p){

Callers 1

plnorm_0Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected