The R Project SVN R

Rev

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

Rev 18510 Rev 19729
Line 34... Line 34...
34
    if (scale <= 0) ML_ERR_return_NAN;
34
    if (scale <= 0) ML_ERR_return_NAN;
35
#endif
35
#endif
36
 
36
 
37
    if (x <= 0.)
37
    if (x <= 0.)
38
	return R_DT_0;
38
	return R_DT_0;
-
 
39
    /* same as weibull( shape = 1): */
-
 
40
    x = -(x / scale);
39
    if (lower_tail)
41
    if (lower_tail)
40
	return  R_D_val(-expm1(-x / scale));
42
	return (log_p
41
    if (log_p) /* && !lower_tail */
43
		/* log(1 - exp(x))  for x < 0 : */
-
 
44
		? (x > -M_LN2 ? log(-expm1(x)) : log1p(-exp(x)))
42
	return (-x / scale);
45
		: -expm1(x));
43
    /* else !log_p and !lower_tail :*/
46
    /* else:  !lower_tail */
44
    return exp(-x / scale);
47
    return R_D_exp(x);
45
}
48
}