Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LogConsts Namespace Reference

Functions

G4double get_log_px (const G4double x)
G4double get_log_qx (const G4double x)
G4double getMantExponent (const G4double x, G4double &fe)
 Like frexp but vectorising and the exponent is a double.
G4float getMantExponentf (const G4float x, G4float &fe)
 Like frexp but vectorising and the exponent is a float.
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

◆ get_log_poly()

G4float G4LogConsts::get_log_poly ( const G4float x)
inline

Definition at line 224 of file G4Log.hh.

225 {
226 G4float y = x * PX1logf;
227 y += PX2logf;
228 y *= x;
229 y += PX3logf;
230 y *= x;
231 y += PX4logf;
232 y *= x;
233 y += PX5logf;
234 y *= x;
235 y += PX6logf;
236 y *= x;
237 y += PX7logf;
238 y *= x;
239 y += PX8logf;
240 y *= x;
241 y += PX9logf;
242 return y;
243 }
float G4float
Definition G4Types.hh:84
const G4float PX1logf
Definition G4Log.hh:214
const G4float PX8logf
Definition G4Log.hh:221
const G4float PX6logf
Definition G4Log.hh:219
const G4float PX3logf
Definition G4Log.hh:216
const G4float PX9logf
Definition G4Log.hh:222
const G4float PX2logf
Definition G4Log.hh:215
const G4float PX5logf
Definition G4Log.hh:218
const G4float PX7logf
Definition G4Log.hh:220
const G4float PX4logf
Definition G4Log.hh:217

Referenced by G4Logf().

◆ get_log_px()

G4double G4LogConsts::get_log_px ( const G4double x)
inline

Definition at line 81 of file G4Log.hh.

82 {
83 const G4double PX1log = 1.01875663804580931796E-4;
84 const G4double PX2log = 4.97494994976747001425E-1;
85 const G4double PX3log = 4.70579119878881725854E0;
86 const G4double PX4log = 1.44989225341610930846E1;
87 const G4double PX5log = 1.79368678507819816313E1;
88 const G4double PX6log = 7.70838733755885391666E0;
89
90 G4double px = PX1log;
91 px *= x;
92 px += PX2log;
93 px *= x;
94 px += PX3log;
95 px *= x;
96 px += PX4log;
97 px *= x;
98 px += PX5log;
99 px *= x;
100 px += PX6log;
101 return px;
102 }
double G4double
Definition G4Types.hh:83

Referenced by G4Log().

◆ get_log_qx()

G4double G4LogConsts::get_log_qx ( const G4double x)
inline

Definition at line 104 of file G4Log.hh.

105 {
106 const G4double QX1log = 1.12873587189167450590E1;
107 const G4double QX2log = 4.52279145837532221105E1;
108 const G4double QX3log = 8.29875266912776603211E1;
109 const G4double QX4log = 7.11544750618563894466E1;
110 const G4double QX5log = 2.31251620126765340583E1;
111
112 G4double qx = x;
113 qx += QX1log;
114 qx *= x;
115 qx += QX2log;
116 qx *= x;
117 qx += QX3log;
118 qx *= x;
119 qx += QX4log;
120 qx *= x;
121 qx += QX5log;
122 return qx;
123 }

Referenced by G4Log().

◆ getMantExponent()

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

Like frexp but vectorising and the exponent is a double.

Definition at line 127 of file G4Log.hh.

128 {
129 uint64_t n = G4IEEE754::dp2uint64(x);
130
131 // Shift to the right up to the beginning of the exponent.
132 // Then with a mask, cut off the sign bit
133 uint64_t le = (n >> 52);
134
135 // chop the head of the number: an int contains more than 11 bits (32)
136 int32_t e =
137 (int32_t)le; // This is important since sums on uint64_t do not vectorise
138 fe = e - 1023;
139
140 // This puts to 11 zeroes the exponent
141 n &= 0x800FFFFFFFFFFFFFULL;
142 // build a mask which is 0.5, i.e. an exponent equal to 1022
143 // which means *2, see the above +1.
144 const uint64_t p05 = 0x3FE0000000000000ULL; // dp2uint64(0.5);
145 n |= p05;
146
147 return G4IEEE754::uint642dp(n);
148 }
G4fissionEvent * fe
G4double uint642dp(uint64_t ll)
Definition G4IEEE754.hh:66
uint64_t dp2uint64(G4double x)
Definition G4IEEE754.hh:56

Referenced by G4Log().

◆ getMantExponentf()

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

Like frexp but vectorising and the exponent is a float.

Definition at line 152 of file G4Log.hh.

153 {
154 uint32_t n = G4IEEE754::sp2uint32(x);
155 int32_t e = (n >> 23) - 127;
156 fe = e;
157
158 // fractional part
159 const uint32_t p05f = 0x3f000000; // //sp2uint32(0.5);
160 n &= 0x807fffff; // ~0x7f800000;
161 n |= p05f;
162
163 return G4IEEE754::uint322sp(n);
164 }
uint32_t sp2uint32(G4float x)
Definition G4IEEE754.hh:86
G4float uint322sp(G4int x)
Definition G4IEEE754.hh:76

Referenced by G4Logf().

Variable Documentation

◆ LOG_LOWER_LIMIT

const G4double G4LogConsts::LOG_LOWER_LIMIT = 0

Definition at line 76 of file G4Log.hh.

Referenced by G4Log().

◆ LOG_UPPER_LIMIT

const G4double G4LogConsts::LOG_UPPER_LIMIT = 1e307

Definition at line 75 of file G4Log.hh.

Referenced by G4Log().

◆ LOGF_LOWER_LIMIT

const G4float G4LogConsts::LOGF_LOWER_LIMIT = 0

Definition at line 212 of file G4Log.hh.

Referenced by G4Logf().

◆ LOGF_UPPER_LIMIT

const G4float G4LogConsts::LOGF_UPPER_LIMIT = MAXNUMF

Definition at line 211 of file G4Log.hh.

Referenced by G4Logf().

◆ MAXNUMF

const G4float G4LogConsts::MAXNUMF = 3.4028234663852885981170418348451692544e38f

Definition at line 79 of file G4Log.hh.

◆ PX1logf

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

Definition at line 214 of file G4Log.hh.

Referenced by get_log_poly().

◆ PX2logf

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

Definition at line 215 of file G4Log.hh.

Referenced by get_log_poly().

◆ PX3logf

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

Definition at line 216 of file G4Log.hh.

Referenced by get_log_poly().

◆ PX4logf

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

Definition at line 217 of file G4Log.hh.

Referenced by get_log_poly().

◆ PX5logf

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

Definition at line 218 of file G4Log.hh.

Referenced by get_log_poly().

◆ PX6logf

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

Definition at line 219 of file G4Log.hh.

Referenced by get_log_poly().

◆ PX7logf

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

Definition at line 220 of file G4Log.hh.

Referenced by get_log_poly().

◆ PX8logf

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

Definition at line 221 of file G4Log.hh.

Referenced by get_log_poly().

◆ PX9logf

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

Definition at line 222 of file G4Log.hh.

Referenced by get_log_poly().

◆ SQRTH

const G4double G4LogConsts::SQRTH = 0.70710678118654752440

Definition at line 78 of file G4Log.hh.

Referenced by G4Log().

◆ SQRTHF

const G4float G4LogConsts::SQRTHF = 0.707106781186547524f

Definition at line 245 of file G4Log.hh.

Referenced by G4Logf().