49 G4Pow* G4Pow::fpInstance = 0;
57 fpInstance =
new G4Pow;
65 : onethird(1.0/3.0), max2(5)
69 "Attempt to instantiate G4Pow in worker thread");
72 const G4int maxZ = 512;
73 const G4int maxZfact = 170;
76 maxA2 = 1.25 + max2*0.2;
77 maxAexp = -0.76+ maxZfact*0.5;
79 ener.resize(max2+1,1.0);
80 logen.resize(max2+1,0.0);
81 lz2.resize(max2+1,0.0);
82 pz13.resize(maxZ,0.0);
84 fexp.resize(maxZfact,0.0);
85 fact.resize(maxZfact,0.0);
86 logfact.resize(maxZ,0.0);
93 for(
G4int i=1; i<=max2; ++i)
95 ener[i] =
powN(500.,i);
96 logen[i]=
G4Log(ener[i]);
97 lz2[i] =
G4Log(1.0 + i*0.2);
100 for(
G4int i=1; i<maxZ; ++i)
103 pz13[i] = std::pow(x,onethird);
109 fexp[i] =
G4Exp(0.5*i);
120 delete fpInstance; fpInstance = 0;
127 if(std::abs(n) > 8) {
return std::pow(x,
G4double(n)); }
129 if(n >= 0) {
for(
G4int i=0; i<
n; ++i) { res *=
x; } }
130 else if((n < 0) && (x != 0.0))
134 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.