The R Project SVN R

Rev

Rev 77685 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 77685 Rev 90186
Line 29... Line 29...
29
{
29
{
30
#ifdef IEEE_754
30
#ifdef IEEE_754
31
    if (ISNAN(x) || ISNAN(shape) || ISNAN(scale))
31
    if (ISNAN(x) || ISNAN(shape) || ISNAN(scale))
32
	return x + shape + scale;
32
	return x + shape + scale;
33
#endif
33
#endif
34
    if(shape <= 0 || scale <= 0) ML_WARN_return_NAN;
34
    if(shape < 0 || scale <= 0) ML_WARN_return_NAN;
-
 
35
 
-
 
36
    R_P_bounds_01(x, 0., ML_POSINF);
35
 
37
 
36
    if (x <= 0)
-
 
37
	return R_DT_0;
-
 
38
    x = -pow(x / scale, shape);
38
    x = -pow(x / scale, shape);
39
    return lower_tail
39
    return lower_tail
40
	? (log_p ? R_Log1_Exp(x) : -expm1(x))
40
	? (log_p ? R_Log1_Exp(x) : -expm1(x))
41
	: R_D_exp(x);
41
	: R_D_exp(x);
42
}
42
}