Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4LogConsts Namespace Reference

Classes

union  ieee754
 

Functions

G4double get_log_px (const G4double x)
 
G4double get_log_qx (const G4double x)
 
uint64_t dp2uint64 (G4double x)
 
G4double uint642dp (uint64_t ll)
 
G4float uint322sp (G4int x)
 
uint32_t sp2uint32 (G4float x)
 
G4double getMantExponent (const G4double x, G4double &fe)
 Like frexp but vectorising and the exponent is a double. More...
 
G4float getMantExponentf (const G4float x, G4float &fe)
 Like frexp but vectorising and the exponent is a float. More...
 
G4float get_log_poly (const G4float x)
 

Variables

const G4double LOG_UPPER_LIMIT = 1e307
 
const G4double LOG_LOWER_LIMIT = 0
 
const G4double SQRTH = 0.70710678118654752440
 
const G4float MAXNUMF = 3.4028234663852885981170418348451692544e38f
 
const G4float LOGF_UPPER_LIMIT = MAXNUMF
 
const G4float LOGF_LOWER_LIMIT = 0
 
const G4float PX1logf = 7.0376836292E-2f
 
const G4float PX2logf = -1.1514610310E-1f
 
const G4float PX3logf = 1.1676998740E-1f
 
const G4float PX4logf = -1.2420140846E-1f
 
const G4float PX5logf = 1.4249322787E-1f
 
const G4float PX6logf = -1.6668057665E-1f
 
const G4float PX7logf = 2.0000714765E-1f
 
const G4float PX8logf = -2.4999993993E-1f
 
const G4float PX9logf = 3.3333331174E-1f
 
const G4float SQRTHF = 0.707106781186547524f
 

Function Documentation

uint64_t G4LogConsts::dp2uint64 ( G4double  x)
inline

Definition at line 150 of file G4Log.hh.

151  {
152  ieee754 tmp;
153  tmp.d=x;
154  return tmp.ll;
155  }

Here is the caller graph for this function:

G4float G4LogConsts::get_log_poly ( const G4float  x)
inline

Definition at line 285 of file G4Log.hh.

286  {
287  G4float y = x*PX1logf;
288  y += PX2logf;
289  y *= x;
290  y += PX3logf;
291  y *= x;
292  y += PX4logf;
293  y *= x;
294  y += PX5logf;
295  y *= x;
296  y += PX6logf;
297  y *= x;
298  y += PX7logf;
299  y *= x;
300  y += PX8logf;
301  y *= x;
302  y += PX9logf;
303  return y;
304  }
const G4float PX1logf
Definition: G4Log.hh:275
const G4float PX2logf
Definition: G4Log.hh:276
float G4float
Definition: G4Types.hh:77
const G4float PX4logf
Definition: G4Log.hh:278
const G4float PX6logf
Definition: G4Log.hh:280
const G4float PX9logf
Definition: G4Log.hh:283
const G4float PX7logf
Definition: G4Log.hh:281
const G4float PX5logf
Definition: G4Log.hh:279
const G4float PX8logf
Definition: G4Log.hh:282
const G4float PX3logf
Definition: G4Log.hh:277

Here is the caller graph for this function:

G4double G4LogConsts::get_log_px ( const G4double  x)
inline

Definition at line 103 of file G4Log.hh.

104  {
105  const G4double PX1log = 1.01875663804580931796E-4;
106  const G4double PX2log = 4.97494994976747001425E-1;
107  const G4double PX3log = 4.70579119878881725854E0;
108  const G4double PX4log = 1.44989225341610930846E1;
109  const G4double PX5log = 1.79368678507819816313E1;
110  const G4double PX6log = 7.70838733755885391666E0;
111 
112  G4double px = PX1log;
113  px *= x;
114  px += PX2log;
115  px *= x;
116  px += PX3log;
117  px *= x;
118  px += PX4log;
119  px *= x;
120  px += PX5log;
121  px *= x;
122  px += PX6log;
123  return px;
124  }
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4LogConsts::get_log_qx ( const G4double  x)
inline

Definition at line 126 of file G4Log.hh.

127  {
128  const G4double QX1log = 1.12873587189167450590E1;
129  const G4double QX2log = 4.52279145837532221105E1;
130  const G4double QX3log = 8.29875266912776603211E1;
131  const G4double QX4log = 7.11544750618563894466E1;
132  const G4double QX5log = 2.31251620126765340583E1;
133 
134  G4double qx = x;
135  qx += QX1log;
136  qx *=x;
137  qx += QX2log;
138  qx *=x;
139  qx += QX3log;
140  qx *=x;
141  qx += QX4log;
142  qx *=x;
143  qx += QX5log;
144  return qx;
145  }
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4LogConsts::getMantExponent ( const G4double  x,
G4double fe 
)
inline

Like frexp but vectorising and the exponent is a double.

Definition at line 189 of file G4Log.hh.

190  {
191  uint64_t n = dp2uint64(x);
192 
193  // Shift to the right up to the beginning of the exponent.
194  // Then with a mask, cut off the sign bit
195  uint64_t le = (n >> 52);
196 
197  // chop the head of the number: an int contains more than 11 bits (32)
198  int32_t e = le; // This is important since sums on uint64_t do not vectorise
199  fe = e-1023 ;
200 
201  // This puts to 11 zeroes the exponent
202  n &=0x800FFFFFFFFFFFFFULL;
203  // build a mask which is 0.5, i.e. an exponent equal to 1022
204  // which means *2, see the above +1.
205  const uint64_t p05 = 0x3FE0000000000000ULL; //dp2uint64(0.5);
206  n |= p05;
207 
208  return uint642dp(n);
209  }
uint64_t dp2uint64(G4double x)
Definition: G4Log.hh:150
G4double uint642dp(uint64_t ll)
Definition: G4Exp.hh:124
G4fissionEvent * fe

Here is the call graph for this function:

Here is the caller graph for this function:

G4float G4LogConsts::getMantExponentf ( const G4float  x,
G4float fe 
)
inline

Like frexp but vectorising and the exponent is a float.

Definition at line 213 of file G4Log.hh.

214  {
215  uint32_t n = sp2uint32(x);
216  int32_t e = (n >> 23)-127;
217  fe = e;
218 
219  // fractional part
220  const uint32_t p05f = 0x3f000000; // //sp2uint32(0.5);
221  n &= 0x807fffff;// ~0x7f800000;
222  n |= p05f;
223 
224  return uint322sp(n);
225  }
uint32_t sp2uint32(G4float x)
Definition: G4Exp.hh:144
G4float uint322sp(G4int x)
Definition: G4Exp.hh:134
G4fissionEvent * fe

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t G4LogConsts::sp2uint32 ( G4float  x)
inline

Definition at line 180 of file G4Log.hh.

181  {
182  ieee754 tmp;
183  tmp.f[0]=x;
184  return tmp.i[0];
185  }

Here is the caller graph for this function:

G4float G4LogConsts::uint322sp ( G4int  x)
inline

Definition at line 170 of file G4Log.hh.

171  {
172  ieee754 tmp;
173  tmp.i[0]=x;
174  return tmp.f[0];
175  }

Here is the caller graph for this function:

G4double G4LogConsts::uint642dp ( uint64_t  ll)
inline

Definition at line 160 of file G4Log.hh.

161  {
162  ieee754 tmp;
163  tmp.ll=ll;
164  return tmp.d;
165  }

Here is the caller graph for this function:

Variable Documentation

const G4double G4LogConsts::LOG_LOWER_LIMIT = 0

Definition at line 80 of file G4Log.hh.

const G4double G4LogConsts::LOG_UPPER_LIMIT = 1e307

Definition at line 79 of file G4Log.hh.

const G4float G4LogConsts::LOGF_LOWER_LIMIT = 0

Definition at line 273 of file G4Log.hh.

const G4float G4LogConsts::LOGF_UPPER_LIMIT = MAXNUMF

Definition at line 272 of file G4Log.hh.

const G4float G4LogConsts::MAXNUMF = 3.4028234663852885981170418348451692544e38f

Definition at line 83 of file G4Log.hh.

const G4float G4LogConsts::PX1logf = 7.0376836292E-2f

Definition at line 275 of file G4Log.hh.

const G4float G4LogConsts::PX2logf = -1.1514610310E-1f

Definition at line 276 of file G4Log.hh.

const G4float G4LogConsts::PX3logf = 1.1676998740E-1f

Definition at line 277 of file G4Log.hh.

const G4float G4LogConsts::PX4logf = -1.2420140846E-1f

Definition at line 278 of file G4Log.hh.

const G4float G4LogConsts::PX5logf = 1.4249322787E-1f

Definition at line 279 of file G4Log.hh.

const G4float G4LogConsts::PX6logf = -1.6668057665E-1f

Definition at line 280 of file G4Log.hh.

const G4float G4LogConsts::PX7logf = 2.0000714765E-1f

Definition at line 281 of file G4Log.hh.

const G4float G4LogConsts::PX8logf = -2.4999993993E-1f

Definition at line 282 of file G4Log.hh.

const G4float G4LogConsts::PX9logf = 3.3333331174E-1f

Definition at line 283 of file G4Log.hh.

const G4double G4LogConsts::SQRTH = 0.70710678118654752440

Definition at line 82 of file G4Log.hh.

const G4float G4LogConsts::SQRTHF = 0.707106781186547524f

Definition at line 306 of file G4Log.hh.