The R Project SVN R

Rev

Rev 19500 | Rev 29586 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19500 Rev 28063
Line 89... Line 89...
89
	return x;
89
	return x;
90
#endif
90
#endif
91
    if (x <= 0.)
91
    if (x <= 0.)
92
	return R_DT_0;
92
	return R_DT_0;
93
 
93
 
94
    /* use a normal approximation if alph > alphlimit */
94
    if (alph > alphlimit) { /* use a normal approximation */
95
 
-
 
96
    if (alph > alphlimit) {
-
 
97
	pn1 = sqrt(alph) * 3. * (pow(x/alph, 1./3.) + 1. / (9. * alph) - 1.);
95
	pn1 = sqrt(alph) * 3. * (pow(x/alph, 1./3.) + 1. / (9. * alph) - 1.);
98
	return pnorm(pn1, 0., 1., lower_tail, log_p);
96
	return pnorm(pn1, 0., 1., lower_tail, log_p);
99
    }
97
    }
100
 
98
 
101
    /* if x is extremely large __compared to alph__ then return 1 */
99
    /* if x is extremely large __compared to alph__ then return 1 */
Line 151... Line 149...
151
	    pn1 = pn3;
149
	    pn1 = pn3;
152
	    pn2 = pn4;
150
	    pn2 = pn4;
153
	    pn3 = pn5;
151
	    pn3 = pn5;
154
	    pn4 = pn6;
152
	    pn4 = pn6;
155
	    if (fabs(pn5) >= xlarge) {
153
	    if (fabs(pn5) >= xlarge) {
156
 
-
 
157
		/* re-scale the terms in continued fraction if they are large */
154
		/* re-scale the terms in continued fraction if they are large */
158
#ifdef DEBUG_p
155
#ifdef DEBUG_p
159
		REprintf(" [r] ");
156
		REprintf(" [r] ");
160
#endif
157
#endif
161
		pn1 /= xlarge;
158
		pn1 /= xlarge;