The R Project SVN R

Rev

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

Rev 8431 Rev 18535
Line 51... Line 51...
51
    /* Use "1 - v"  if	lower_tail  and	 x > 0 (but not both):*/
51
    /* Use "1 - v"  if	lower_tail  and	 x > 0 (but not both):*/
52
    if(x <= 0.)
52
    if(x <= 0.)
53
	lower_tail = !lower_tail;
53
	lower_tail = !lower_tail;
54
 
54
 
55
    if(log_p) {
55
    if(log_p) {
56
	if(lower_tail) return log(1 - 0.5*exp(val));
56
	if(lower_tail) return log1p(-0.5*exp(val));
57
	else return val - M_LN2; /* = log(.5* pbeta(....)) */
57
	else return val - M_LN2; /* = log(.5* pbeta(....)) */
58
    }
58
    }
59
    else {
59
    else {
60
	val /= 2.;
60
	val /= 2.;
61
	return R_D_Cval(val);
61
	return R_D_Cval(val);