47 #ifdef G4MULTITHREADED
51 G4Pow* G4Pow::fpInstance = 0;
59 static G4Pow geant4pow;
60 fpInstance = &geant4pow;
68 : onethird(1.0/3.0), max2(5)
70 #ifdef G4MULTITHREADED
74 "Attempt to instantiate G4Pow in worker thread!");
77 const G4int maxZ = 512;
78 const G4int maxZfact = 170;
81 maxA2 = 1.25 + max2*0.2;
82 maxAexp = -0.76+ maxZfact*0.5;
84 ener.resize(max2+1,1.0);
85 logen.resize(max2+1,0.0);
86 lz2.resize(max2+1,0.0);
87 pz13.resize(maxZ,0.0);
89 fexp.resize(maxZfact,0.0);
90 fact.resize(maxZfact,0.0);
91 logfact.resize(maxZ,0.0);
98 for(
G4int i=1; i<=max2; ++i)
100 ener[i] =
powN(500.,i);
101 logen[i]=
G4Log(ener[i]);
102 lz2[i] =
G4Log(1.0 + i*0.2);
105 for(
G4int i=1; i<maxZ; ++i)
108 pz13[i] = std::pow(x,onethird);
114 fexp[i] =
G4Exp(0.5*i);
130 if(0.0 == x) {
return 0.0; }
131 if(std::abs(n) > 8) {
return std::pow(x,
G4double(n)); }
133 if(n >= 0) {
for(
G4int i=0; i<
n; ++i) { res *= x; } }
138 for(
G4int i=0; i<
nn; ++i) { res *= y; }
static G4Pow * GetInstance()
G4double powN(G4double x, G4int n) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.