The R Project SVN R

Rev

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

Rev 34249 Rev 34258
Line 73... Line 73...
73
    /* If x is infinite then return 0 */
73
    /* If x is infinite then return 0 */
74
    if(!R_FINITE(x))
74
    if(!R_FINITE(x))
75
	return R_D__0;
75
	return R_D__0;
76
 
76
 
77
    /* If infinite df then the density is identical to a
77
    /* If infinite df then the density is identical to a
78
       normal distribution with mean = ncp.  Howveer, the formula
78
       normal distribution with mean = ncp.  However, the formula
79
       loses accuracy around df=1e9
79
       loses a lot of accuracy around df=1e9
80
    */
80
    */
81
    if(!R_FINITE(df) || df > 1e9)
81
    if(!R_FINITE(df) || df > 1e8)
82
	return dnorm(x, ncp, 1., give_log);
82
	return dnorm(x, ncp, 1., give_log);
83
 
83
 
84
    /* Consider two cases: x==0 or not */
84
    /* Consider two cases: x==0 or not */
85
    /* Do calculations on log scale to stabilize */
85
    /* Do calculations on log scale to stabilize */
86
    if (x != 0) {
86
    if (x != 0) {