Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
c_randi8.c
Go to the documentation of this file.
1 
2 #include <math.h>
3 
4 
10 double randlc(double * X, double A){
11 
12  long long Lx, La;
13  long long i246m1 = 0x00003FFFFFFFFFFFLL;
14  double d2m46 = pow(0.5,46.0);
15 
16  Lx = (long long) *X; La = (long long) A;
17 
18  Lx = (Lx * La) & i246m1;
19  (*X) = (double) Lx;
20 
21  return (d2m46 * (double) Lx);
22 }
23 
24 
25 
26 void vranlc(N, X, A, Y)
27 int N;
28 double *X;
29 double A;
30 double Y[];
31 {
32  int i;
33  long long Lx, La;
34  long long i246m1 = 0x00003FFFFFFFFFFFLL;
35  double d2m46 = pow(0.5,46.0);
36 
37  Lx = (long long) *X; La = (long long) A;
38 
39  for(i=0;i<N;i++){
40 
41  Lx = (Lx * La) & i246m1;
42  Y[i] = d2m46 * (double) Lx;
43  }
44  (*X) = (double) Lx;
45 
46  return;
47 }
48 
49 
#define A
Definition: mg.c:64
void vranlc(int N, double *X, double A, Y)
Definition: c_randi8.c:26
double randlc(double *X, double *A)
Definition: c_randlc.c:40