The R Project SVN R

Rev

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

Rev 82982 Rev 87504
Line 1... Line 1...
1
/*
1
/*
2
 *  Mathlib : A C Library of Special Functions
2
 *  Mathlib : A C Library of Special Functions
-
 
3
 *  Copyright (C) 2000-2025 The R Core Team
3
 *  Copyright (C) 1998   Ross Ihaka
4
 *  Copyright (C) 1998   Ross Ihaka
4
 *  Copyright (C) 2000-2022 The R Core Team
-
 
5
 *
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
9
 *  (at your option) any later version.
Line 265... Line 265...
265
    case INVERSION:
265
    case INVERSION:
266
#define BIG 134217728 /* 2^27 */
266
#define BIG 134217728 /* 2^27 */
267
	/* unif_rand() alone is not of high enough precision */
267
	/* unif_rand() alone is not of high enough precision */
268
	u1 = unif_rand();
268
	u1 = unif_rand();
269
	u1 = (int)(BIG*u1) + unif_rand();
269
	u1 = (int)(BIG*u1) + unif_rand();
270
	return qnorm5(u1/BIG, 0.0, 1.0, 1, 0);
270
	return qnorm(u1/BIG, 0.0, 1.0, 1, 0);
271
    case KINDERMAN_RAMAGE: /* see Reference above */
271
    case KINDERMAN_RAMAGE: /* see Reference above */
272
	/* corrected version from Josef Leydold
272
	/* corrected version from Josef Leydold
273
	 * */
273
	 * */
274
	u1 = unif_rand();
274
	u1 = unif_rand();
275
	if(u1 < 0.884070402298758) {
275
	if(u1 < 0.884070402298758) {