The R Project SVN R

Rev

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

Rev 68947 Rev 77685
Line 27... Line 27...
27
#ifdef IEEE_754
27
#ifdef IEEE_754
28
    if (ISNAN(x) || ISNAN(location) || ISNAN(scale))
28
    if (ISNAN(x) || ISNAN(location) || ISNAN(scale))
29
	return x + location + scale;
29
	return x + location + scale;
30
#endif
30
#endif
31
    if (scale <= 0.0)
31
    if (scale <= 0.0)
32
	ML_ERR_return_NAN;
32
	ML_WARN_return_NAN;
33
 
33
 
34
    x = fabs((x - location) / scale);
34
    x = fabs((x - location) / scale);
35
    e = exp(-x);
35
    e = exp(-x);
36
    f = 1.0 + e;
36
    f = 1.0 + e;
37
    return give_log ? -(x + log(scale * f * f)) : e / (scale * f * f);
37
    return give_log ? -(x + log(scale * f * f)) : e / (scale * f * f);