The R Project SVN R

Rev

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

Rev 19500 Rev 24049
Line 83... Line 83...
83
    static double s, s2, d;    /* no. 1 (step 1) */
83
    static double s, s2, d;    /* no. 1 (step 1) */
84
    static double q0, b, si, c;/* no. 2 (step 4) */
84
    static double q0, b, si, c;/* no. 2 (step 4) */
85
 
85
 
86
    double e, p, q, r, t, u, v, w, x, ret_val;
86
    double e, p, q, r, t, u, v, w, x, ret_val;
87
 
87
 
-
 
88
    if (!R_FINITE(a) || !R_FINITE(scale))
-
 
89
	ML_ERR_return_NAN;
-
 
90
 
88
    if (a < 1.) { /* GS algorithm for parameters a < 1 */
91
    if (a < 1.) { /* GS algorithm for parameters a < 1 */
89
	e = 1.0 + exp_m1 * a;
92
	e = 1.0 + exp_m1 * a;
90
	repeat {
93
	repeat {
91
	    p = e * unif_rand();
94
	    p = e * unif_rand();
92
	    if (p >= 1.0) {
95
	    if (p >= 1.0) {