The R Project SVN R

Rev

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

Rev 59222 Rev 60268
Line 56... Line 56...
56
{
56
{
57
    const static double eps = 1.e-15;
57
    const static double eps = 1.e-15;
58
 
58
 
59
    int kMax;
59
    int kMax;
60
    double k, ncp2, dx2, d, D, term;
60
    double k, ncp2, dx2, d, D, term;
61
    long double sum, p_k, q;
61
    LDOUBLE sum, p_k, q;
62
 
62
 
63
#ifdef IEEE_754
63
#ifdef IEEE_754
64
    if (ISNAN(x) || ISNAN(a) || ISNAN(b) || ISNAN(ncp))
64
    if (ISNAN(x) || ISNAN(a) || ISNAN(b) || ISNAN(ncp))
65
	return x + a + b + ncp;
65
	return x + a + b + ncp;
66
#endif
66
#endif
Line 116... Line 116...
116
	k++;
116
	k++;
117
	term *= q;
117
	term *= q;
118
	sum += term;
118
	sum += term;
119
    } while (term > sum * eps);
119
    } while (term > sum * eps);
120
 
120
 
-
 
121
#ifdef HAVE_LONG_DOUBLE
121
    return R_D_exp((double)(p_k + logl(sum)));
122
    return R_D_exp((double)(p_k + logl(sum)));
-
 
123
#else
-
 
124
    return R_D_exp((double)(p_k + log(sum)));
-
 
125
#endif
122
}
126
}