Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Exp.hh File Reference
#include "G4Types.hh"
#include <limits>
#include <stdint.h>

Go to the source code of this file.

Classes

union  G4ExpConsts::ieee754
 

Namespaces

namespace  G4ExpConsts
 

Functions

G4double G4ExpConsts::uint642dp (uint64_t ll)
 
G4float G4ExpConsts::uint322sp (G4int x)
 
uint32_t G4ExpConsts::sp2uint32 (G4float x)
 
G4double G4ExpConsts::fpfloor (const G4double x)
 
G4float G4ExpConsts::fpfloor (const G4float x)
 
G4double G4Exp (G4double initial_x)
 Exponential Function double precision.
 
G4float G4Expf (G4float initial_x)
 Exponential Function single precision.
 
void expv (const uint32_t size, G4double const *__restrict__ iarray, G4double *__restrict__ oarray)
 
void G4Expv (const uint32_t size, G4double const *__restrict__ iarray, G4double *__restrict__ oarray)
 
void expfv (const uint32_t size, G4float const *__restrict__ iarray, G4float *__restrict__ oarray)
 
void G4Expfv (const uint32_t size, G4float const *__restrict__ iarray, G4float *__restrict__ oarray)
 

Variables

const G4double G4ExpConsts::EXP_LIMIT = 708
 
const G4double G4ExpConsts::PX1exp = 1.26177193074810590878E-4
 
const G4double G4ExpConsts::PX2exp = 3.02994407707441961300E-2
 
const G4double G4ExpConsts::PX3exp = 9.99999999999999999910E-1
 
const G4double G4ExpConsts::QX1exp = 3.00198505138664455042E-6
 
const G4double G4ExpConsts::QX2exp = 2.52448340349684104192E-3
 
const G4double G4ExpConsts::QX3exp = 2.27265548208155028766E-1
 
const G4double G4ExpConsts::QX4exp = 2.00000000000000000009E0
 
const G4double G4ExpConsts::LOG2E = 1.4426950408889634073599
 
const G4float G4ExpConsts::MAXLOGF = 88.72283905206835f
 
const G4float G4ExpConsts::MINLOGF = -88.f
 
const G4float G4ExpConsts::C1F = 0.693359375f
 
const G4float G4ExpConsts::C2F = -2.12194440e-4f
 
const G4float G4ExpConsts::PX1expf = 1.9875691500E-4f
 
const G4float G4ExpConsts::PX2expf = 1.3981999507E-3f
 
const G4float G4ExpConsts::PX3expf = 8.3334519073E-3f
 
const G4float G4ExpConsts::PX4expf = 4.1665795894E-2f
 
const G4float G4ExpConsts::PX5expf = 1.6666665459E-1f
 
const G4float G4ExpConsts::PX6expf = 5.0000001201E-1f
 
const G4float G4ExpConsts::LOG2EF = 1.44269504088896341f
 

Function Documentation

◆ expfv()

void expfv ( const uint32_t  size,
G4float const *__restrict__  iarray,
G4float *__restrict__  oarray 
)

◆ expv()

void expv ( const uint32_t  size,
G4double const *__restrict__  iarray,
G4double *__restrict__  oarray 
)

◆ G4Exp()

G4double G4Exp ( G4double  initial_x)
inline

Exponential Function double precision.

Definition at line 179 of file G4Exp.hh.

180{
181 G4double x = initial_x;
183
184 const int32_t n = int32_t(px);
185
186 x -= px * 6.93145751953125E-1;
187 x -= px * 1.42860682030941723212E-6;
188
189 const G4double xx = x * x;
190
191 // px = x * P(x**2).
193 px *= xx;
195 px *= xx;
197 px *= x;
198
199 // Evaluate Q(x**2).
201 qx *= xx;
203 qx *= xx;
205 qx *= xx;
207
208 // e**x = 1 + 2x P(x**2)/( Q(x**2) - P(x**2) )
209 x = px / (qx - px);
210 x = 1.0 + 2.0 * x;
211
212 // Build 2^n in double.
213 x *= G4ExpConsts::uint642dp((((uint64_t) n) + 1023) << 52);
214
215 if(initial_x > G4ExpConsts::EXP_LIMIT)
216 x = std::numeric_limits<G4double>::infinity();
217 if(initial_x < -G4ExpConsts::EXP_LIMIT)
218 x = 0.;
219
220 return x;
221}
double G4double
Definition: G4Types.hh:83
const G4double QX3exp
Definition: G4Exp.hh:79
const G4double QX4exp
Definition: G4Exp.hh:80
G4double uint642dp(uint64_t ll)
Definition: G4Exp.hh:120
const G4double PX3exp
Definition: G4Exp.hh:76
const G4double EXP_LIMIT
Definition: G4Exp.hh:72
G4double fpfloor(const G4double x)
Definition: G4Exp.hh:153
const G4double PX1exp
Definition: G4Exp.hh:74
const G4double QX1exp
Definition: G4Exp.hh:77
const G4double PX2exp
Definition: G4Exp.hh:75
const G4double LOG2E
Definition: G4Exp.hh:82
const G4double QX2exp
Definition: G4Exp.hh:78

Referenced by G4RPGReaction::AddBlackTrackParticles(), G4NuclNuclDiffuseElastic::AmplitudeGG(), G4NuclNuclDiffuseElastic::AmplitudeGla(), G4Nucleus::AnnihilationEvaporationEffects(), G4WilsonAbrasionModel::ApplyYourself(), G4DNAMolecularReactionData::ArrehniusParam(), G4EmCorrections::BarkasCorrection(), G4WilsonAblationModel::BreakItUp(), G4QMDMeanField::Cal2BodyQuantities(), G4StatMFMacroBiNucleon::CalcMeanMultiplicity(), G4StatMFMacroMultiNucleon::CalcMeanMultiplicity(), G4StatMFMacroNucleon::CalcMeanMultiplicity(), G4StatMFMacroTetraNucleon::CalcMeanMultiplicity(), G4StatMFMacroTriNucleon::CalcMeanMultiplicity(), G4StatMFMicroPartition::CalcPartitionProbability(), G4LinLogInterpolation::Calculate(), G4ecpssrBaseKxsModel::CalculateCrossSection(), G4OrlicLiXsModel::CalculateL1CrossSection(), G4ecpssrBaseLixsModel::CalculateL1CrossSection(), G4OrlicLiXsModel::CalculateL2CrossSection(), G4ecpssrBaseLixsModel::CalculateL2CrossSection(), G4OrlicLiXsModel::CalculateL3CrossSection(), G4ecpssrBaseLixsModel::CalculateL3CrossSection(), G4PreCompoundTransitions::CalculateProbability(), G4Reggeons::CalculateXs(), G4QMDCollision::CalFinalStateOfTheBinaryCollisionJQMD(), G4Reggeons::Chi_pomeron(), G4Reggeons::Chi_reggeon(), G4NucleiModel::choosePointAlongTraj(), G4Nucleus::Cinema(), G4Clebsch::ClebschGordanCoeff(), G4KalbachCrossSection::ComputeCrossSection(), G4KleinNishinaCompton::ComputeCrossSectionPerAtom(), G4KleinNishinaModel::ComputeCrossSectionPerAtom(), G4PenelopeGammaConversionModel::ComputeCrossSectionPerAtom(), G4PenelopePhotoElectricModel::ComputeCrossSectionPerAtom(), G4PenelopeRayleighModel::ComputeCrossSectionPerAtom(), G4PenelopeRayleighModelMI::ComputeCrossSectionPerAtom(), G4GammaConversionToMuons::ComputeCrossSectionPerAtom(), G4MuBetheBlochModel::ComputeCrossSectionPerElectron(), G4eDPWAElasticDCS::ComputeCSPerAtom(), G4KokoulinMuonNuclearXS::ComputeDDMicroscopicCrossSection(), G4MuBetheBlochModel::ComputeDEDXPerVolume(), G4MuPairProductionModel::ComputeDMicroscopicCrossSection(), G4LivermoreBremsstrahlungModel::ComputeDXSectionPerAtom(), G4SeltzerBergerModel::ComputeDXSectionPerAtom(), G4GoudsmitSaundersonMscModel::ComputeGeomPathLength(), G4UrbanAdjointMscModel::ComputeGeomPathLength(), G4UrbanMscModel::ComputeGeomPathLength(), G4WentzelVIModel::ComputeGeomPathLength(), G4MuBremsstrahlungModel::ComputeMicroscopicCrossSection(), G4MuPairProductionModel::ComputeMicroscopicCrossSection(), G4EvaporationProbability::ComputeProbability(), G4UrbanAdjointMscModel::ComputeTheta0(), G4UrbanMscModel::ComputeTheta0(), G4UrbanAdjointMscModel::ComputeTrueStepLength(), G4UrbanMscModel::ComputeTrueStepLength(), G4MuPairProductionModel::ComputMuPairLoss(), G4DiffractiveExcitation::CreateStrings(), G4XpimNTotal::CrossSection(), G4XpipNTotal::CrossSection(), G4LowEXsection::CrossSection(), G4DNABornIonisationModel1::CrossSectionPerVolume(), G4DNABornIonisationModel2::CrossSectionPerVolume(), G4EquilibriumEvaporator::deExcite(), G4PreCompoundModel::DeExcite(), G4FissionParameters::DefineParameters(), G4EmCorrections::DensityCorrection(), G4AtimaFluctuations::Dispersion(), G4PenelopeRayleighModel::DumpFormFactorTable(), G4PenelopeRayleighModelMI::DumpFormFactorTable(), G4ionEffectiveCharge::EffectiveCharge(), G4FissionProbability::EmissionProbability(), epsilon(), G4LegendrePolynomial::EvalAssocLegendrePoly(), G4Nucleus::EvaporationEffects(), G4Pow::expA(), G4ecpssrBaseKxsModel::ExpIntFunction(), G4ecpssrBaseLixsModel::ExpIntFunction(), G4QuasiElRatios::FetchElTot(), G4NucleiModel::fillZoneRadii(), G4DNASmoluchowskiReactionModel::FindReaction(), G4JTPolynomialSolver::FindRoots(), G4AtimaEnergyLossModel::G4AtimaEnergyLossModel(), G4AtimaFluctuations::G4AtimaFluctuations(), G4InuclSpecialFunctions::G4cbrt(), G4ElasticHadrNucleusHE::G4ElasticHadrNucleusHE(), G4ParticleHPFissionSpectrum::G4ParticleHPFissionSpectrum(), G4ParticleHPMadlandNixSpectrum::G4ParticleHPMadlandNixSpectrum(), G4ParticleHPSimpleEvapSpectrum::G4ParticleHPSimpleEvapSpectrum(), G4ParticleHPWattSpectrum::G4ParticleHPWattSpectrum(), G4PhysicsLogVector::G4PhysicsLogVector(), G4Poisson(), G4QMDGroundStateNucleus::G4QMDGroundStateNucleus(), G4XNNElasticLowE::G4XNNElasticLowE(), G4XnpElasticLowE::G4XnpElasticLowE(), G4XnpTotalLowE::G4XnpTotalLowE(), G4FTFParameters::GammaElastic(), G4IntraNucleiCascader::generateCascade(), G4eeToHadronsModel::GenerateCMPhoton(), G4FissionStore::generateConfiguration(), G4CascadeFinalStateAlgorithm::GenerateCosTheta(), G4NucleiModel::generateInteractionLength(), G4RPGReaction::GenerateNBodyEvent(), G4RPGReaction::GenerateNBodyEventT(), G4AtomicFormFactor::Get(), G4ParticleHPInterpolator::GetBinIntegral(), G4NeutronInelasticCrossSection::GetCrossSection(), G4DNASmoluchowskiDiffusion::GetCumulativeProbability(), G4IonisParamMat::GetDensityCorrection(), G4DNASmoluchowskiDiffusion::GetDensityProbability(), G4NuclearFermiDensity::GetDeriv(), G4DiffuseElastic::GetDiffElasticProb(), G4NuclNuclDiffuseElastic::GetDiffElasticProb(), G4DiffuseElastic::GetDiffElasticSumProb(), G4NuclNuclDiffuseElastic::GetDiffElasticSumProb(), G4DiffuseElastic::GetDiffElasticSumProbA(), G4DiffuseElasticV2::GetDiffElasticSumProbA(), G4NuclNuclDiffuseElastic::GetDiffElasticSumProbA(), G4DNASmoluchowskiDiffusion::GetDifferential(), G4PhotoNuclearCrossSection::GetElementCrossSection(), G4TripathiCrossSection::GetElementCrossSection(), G4TripathiLightCrossSection::GetElementCrossSection(), G4PhotonEvaporation::GetEmissionProbability(), G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy(), G4ElectroNuclearCrossSection::GetEquivalentPhotonQ2(), G4NuclNuclDiffuseElastic::GetErfComp(), G4ChipsAntiBaryonElasticXS::GetExchangeT(), G4ChipsHyperonElasticXS::GetExchangeT(), G4ChipsPionMinusElasticXS::GetExchangeT(), G4ChipsPionPlusElasticXS::GetExchangeT(), G4NuclNuclDiffuseElastic::GetExpCos(), G4hhElastic::GetExpRatioF123(), G4NuclNuclDiffuseElastic::GetExpSin(), G4PenelopeCrossSection::GetHardCrossSection(), G4RPGInelastic::GetNormalizationConstant(), G4PenelopeCrossSection::GetNormalizedShellCrossSection(), G4Reggeons::GetProbabilities(), G4FTFParameters::GetProcProb(), G4ProtonInelasticCrossSection::GetProtonCrossSection(), G4NuclearFermiDensity::GetRadius(), G4NuclearFermiDensity::GetRelativeDensity(), G4NuclearShellModelDensity::GetRelativeDensity(), G4PenelopePhotoElectricModel::GetShellCrossSection(), G4PenelopeCrossSection::GetShellCrossSection(), G4PenelopeCrossSection::GetSoftStoppingPower(), G4PenelopeCrossSection::GetTotalCrossSection(), G4ElectroNuclearCrossSection::GetVirtualFactor(), G4ParticleHPInterpolator::GetWeightedBinIntegral(), G4EMDissociationCrossSection::GetWilsonProbabilityForProtonDissociation(), G4HadronNucleonXsc::HadronNucleonXscEL(), G4HadronNucleonXsc::HadronNucleonXscNS(), G4HadronNucleonXsc::HadronNucleonXscPDG(), G4HadronNucleonXsc::HadronNucleonXscVU(), G4VhElectronicStoppingPower::HeEffChargeSquare(), G4Bessel::I0(), G4Bessel::I1(), G4FTFParameters::InitForInteraction(), G4WentzelOKandVIxSection::InitialiseA(), G4BetheHeitlerModel::InitialiseElementData(), G4NucleiModel::initializeCascad(), G4GoudsmitSaundersonTable::InitSCPCorrection(), G4eDPWAElasticDCS::InitSCPCorrection(), G4ParticleHPVector::Integrate(), G4LEPTSDiffXS::InterpolateCDXS(), G4Bessel::K0(), G4Bessel::K1(), G4ParticleHPKallbachMannSyst::Kallbach(), G4HadronNucleonXsc::KaonNucleonXscVG(), MCGIDI_KalbachMann_sampleEp(), G4Reggeons::ncPomerons(), G4DiffuseElastic::NeutronTuniform(), G4DiffuseElasticV2::NeutronTuniform(), nf_amc_factorial(), nf_exponentialIntegral(), nf_incompleteGammaFunction(), nf_incompleteGammaFunctionComplementary(), G4PenelopeCrossSection::NormalizeShellCrossSections(), G4Bessel::pI0(), G4Bessel::pI1(), G4RPGInelastic::Pmltpc(), G4GammaConversionToMuons::PostStepDoIt(), G4PenelopeBremsstrahlungAngular::PrepareTables(), G4IonDEDXHandler::PrintDEDXTable(), G4IonParametrisedLossModel::PrintDEDXTable(), G4NuclNuclDiffuseElastic::ProfileFar(), G4NuclNuclDiffuseElastic::ProfileNear(), ptwXY_createGaussianCenteredSigma1(), ptwXY_exp(), ptwXY_interpolatePoint(), ptwXY_thicken(), G4NuclearRadii::RadiusHNGG(), G4NuclearRadii::RadiusNNGG(), G4RPGFragmentation::ReactionStage(), G4RPGStrangeProduction::ReactionStage(), G4RPGTwoBody::ReactionStage(), G4RPGTwoCluster::ReactionStage(), G4RPGReaction::Rotate(), G4Generator2BN::SampleDirection(), G4PenelopeBremsstrahlungAngular::SampleDirection(), G4RayleighAngularGenerator::SampleDirection(), G4eIonisationSpectrum::SampleEnergy(), G4eBremsstrahlungSpectrum::SampleEnergy(), G4SBBremTable::SampleEnergyTransfer(), G4PenelopeBremsstrahlungFS::SampleGammaEnergy(), G4PolarizationTransition::SampleGammaTransition(), G4AntiNuclElastic::SampleInvariantT(), G4HadronElastic::SampleInvariantT(), G4EvaporationProbability::SampleKineticEnergy(), G4GoudsmitSaundersonMscModel::SampleMSC(), G4VLongitudinalStringDecay::SampleQuarkPt(), G4WentzelVIModel::SampleScattering(), G4LivermoreBremsstrahlungModel::SampleSecondaries(), G4eBremParametrizedModel::SampleSecondaries(), G4eBremsstrahlungRelModel::SampleSecondaries(), G4BoldyshevTripletModel::SampleSecondaries(), G4LivermoreComptonModel::SampleSecondaries(), G4LivermoreComptonModifiedModel::SampleSecondaries(), G4LivermoreGammaConversionModelRC::SampleSecondaries(), G4LivermoreNuclearGammaConversionModel::SampleSecondaries(), G4LivermorePolarizedComptonModel::SampleSecondaries(), G4LivermorePolarizedGammaConversionModel::SampleSecondaries(), G4LowEPComptonModel::SampleSecondaries(), G4LowEPPolarizedComptonModel::SampleSecondaries(), G4PenelopeComptonModel::SampleSecondaries(), G4HeatedKleinNishinaCompton::SampleSecondaries(), G4MuBremsstrahlungModel::SampleSecondaries(), G4MuPairProductionModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), G4eeToTwoGammaModel::SampleSecondaries(), G4KleinNishinaCompton::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4eplusTo2GammaOKVIModel::SampleSecondaries(), G4BetheHeitler5DModel::SampleSecondaries(), G4WentzelOKandVIxSection::SampleSingleScattering(), G4ChargeExchange::SampleT(), G4GoudsmitSaundersonTable::Sampling(), G4IonCoulombCrossSection::SetupTarget(), G4hICRU49He::StoppingPower(), G4ePairProduction::StreamProcessInfo(), G4EvaporationProbability::TotalProbability(), G4Clebsch::TriangleCoeff(), G4Clebsch::Wigner6J(), G4Clebsch::WignerLittleD(), G4NucleiModel::zoneIntegralGaussian(), and G4NucleiModel::zoneIntegralWoodsSaxon().

◆ G4Expf()

G4float G4Expf ( G4float  initial_x)
inline

Exponential Function single precision.

Definition at line 226 of file G4Exp.hh.

227{
228 G4float x = initial_x;
229
230 G4float z =
232 0.5f); /* std::floor() truncates toward -infinity. */
233
234 x -= z * G4ExpConsts::C1F;
235 x -= z * G4ExpConsts::C2F;
236 const int32_t n = int32_t(z);
237
238 const G4float x2 = x * x;
239
240 z = x * G4ExpConsts::PX1expf;
242 z *= x;
244 z *= x;
246 z *= x;
248 z *= x;
250 z *= x2;
251 z += x + 1.0f;
252
253 /* multiply by power of 2 */
254 z *= G4ExpConsts::uint322sp((n + 0x7f) << 23);
255
256 if(initial_x > G4ExpConsts::MAXLOGF)
257 z = std::numeric_limits<G4float>::infinity();
258 if(initial_x < G4ExpConsts::MINLOGF)
259 z = 0.f;
260
261 return z;
262}
float G4float
Definition: G4Types.hh:84
const G4float C1F
Definition: G4Exp.hh:87
const G4float PX1expf
Definition: G4Exp.hh:90
const G4float LOG2EF
Definition: G4Exp.hh:97
const G4float PX6expf
Definition: G4Exp.hh:95
G4float uint322sp(G4int x)
Definition: G4Exp.hh:130
const G4float PX4expf
Definition: G4Exp.hh:93
const G4float MINLOGF
Definition: G4Exp.hh:85
const G4float PX3expf
Definition: G4Exp.hh:92
const G4float MAXLOGF
Definition: G4Exp.hh:84
const G4float PX5expf
Definition: G4Exp.hh:94
const G4float PX2expf
Definition: G4Exp.hh:91
const G4float C2F
Definition: G4Exp.hh:88

◆ G4Expfv()

void G4Expfv ( const uint32_t  size,
G4float const *__restrict__  iarray,
G4float *__restrict__  oarray 
)

◆ G4Expv()

void G4Expv ( const uint32_t  size,
G4double const *__restrict__  iarray,
G4double *__restrict__  oarray 
)