37G4Pow* G4Pow::fpInstance =
nullptr;
43 if(fpInstance ==
nullptr)
45 static G4Pow geant4pow;
46 fpInstance = &geant4pow;
59 "Attempt to instantiate G4Pow in worker thread!");
62 const G4int maxZ = 512;
63 const G4int maxZfact = 170;
64 const G4int numLowA = 17;
68 maxA2 = 1.25 + max2 * 0.2;
69 maxAexp = -0.76 + maxZfact * 0.5;
71 ener.resize(max2 + 1, 1.0);
72 logen.resize(max2 + 1, 0.0);
73 lz2.resize(max2 + 1, 0.0);
74 pz13.resize(maxZ, 0.0);
75 lowa13.resize(numLowA, 0.0);
77 fexp.resize(maxZfact, 0.0);
78 fact.resize(maxZfact, 0.0);
79 logfact.resize(maxZ, 0.0);
86 for(
G4int i = 1; i <= max2; ++i)
88 ener[i] =
powN(500., i);
89 logen[i] =
G4Log(ener[i]);
90 lz2[i] =
G4Log(1.0 + i * 0.2);
93 for(
G4int i = 1; i < maxZ; ++i)
96 pz13[i] = std::pow(x, onethird);
102 fexp[i] =
G4Exp(0.5 * i);
108 for(
G4int i = 4; i < numLowA; ++i)
110 lowa13[i] = std::pow(0.25 * i, onethird);
121 const bool invert = (
A < 1.);
123 res = (a < maxLowA) ? A13Low(a, invert) : A13High(a, invert);
136 const G4double x = (a / i - 1.) * onethird;
137 res = pz13[i] * (1. + x - x * x * (1. - 1.666667 * x));
143 res = invert ? 1. / res : res;
152 const G4int i =
static_cast<G4int>(4. * (a + 0.125));
154 const G4double x = (a / y - 1.) * onethird;
155 res = lowa13[i] * (1. + x - x * x * (1. - 1.666667 * x));
156 res = invert ? 1. / res : res;
175 for(
G4int i = 0; i < n; ++i)
184 for(
G4int i = 0; i < nn; ++i)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
static G4Pow * GetInstance()
G4double A13(G4double A) const
G4double powN(G4double x, G4int n) const