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

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 180 of file G4Exp.hh.

181{
182 G4double x = initial_x;
184
185 const int32_t n = int32_t(px);
186
187 x -= px * 6.93145751953125E-1;
188 x -= px * 1.42860682030941723212E-6;
189
190 const G4double xx = x * x;
191
192 // px = x * P(x**2).
194 px *= xx;
196 px *= xx;
198 px *= x;
199
200 // Evaluate Q(x**2).
202 qx *= xx;
204 qx *= xx;
206 qx *= xx;
208
209 // e**x = 1 + 2x P(x**2)/( Q(x**2) - P(x**2) )
210 x = px / (qx - px);
211 x = 1.0 + 2.0 * x;
212
213 // Build 2^n in double.
214 x *= G4ExpConsts::uint642dp((((uint64_t) n) + 1023) << 52);
215
216 if(initial_x > G4ExpConsts::EXP_LIMIT)
217 x = std::numeric_limits<G4double>::infinity();
218 if(initial_x < -G4ExpConsts::EXP_LIMIT)
219 x = 0.;
220
221 return x;
222}
double G4double
Definition G4Types.hh:83
const G4double QX3exp
Definition G4Exp.hh:80
const G4double QX4exp
Definition G4Exp.hh:81
G4double uint642dp(uint64_t ll)
Definition G4Exp.hh:121
const G4double PX3exp
Definition G4Exp.hh:77
const G4double EXP_LIMIT
Definition G4Exp.hh:73
G4double fpfloor(const G4double x)
Definition G4Exp.hh:154
const G4double PX1exp
Definition G4Exp.hh:75
const G4double QX1exp
Definition G4Exp.hh:78
const G4double PX2exp
Definition G4Exp.hh:76
const G4double LOG2E
Definition G4Exp.hh:83
const G4double QX2exp
Definition G4Exp.hh:79

Referenced by G4NuclNuclDiffuseElastic::AmplitudeGG(), G4NuclNuclDiffuseElastic::AmplitudeGla(), G4Nucleus::AnnihilationEvaporationEffects(), G4WilsonAbrasionModel::ApplyYourself(), G4DNAMolecularReactionData::ArrehniusParam(), G4EmCorrections::BarkasCorrection(), G4WilsonAblationModel::BreakItUp(), G4LightIonQMDMeanField::Cal2BodyQuantities(), G4LightIonQMDMeanField::Cal2BodyQuantities(), G4QMDMeanField::Cal2BodyQuantities(), G4QMDMeanField::Cal2BodyQuantities(), G4StatMFMacroBiNucleon::CalcMeanMultiplicity(), G4StatMFMacroMultiNucleon::CalcMeanMultiplicity(), G4StatMFMacroNucleon::CalcMeanMultiplicity(), G4StatMFMacroTetraNucleon::CalcMeanMultiplicity(), G4StatMFMacroTriNucleon::CalcMeanMultiplicity(), G4StatMFMicroPartition::CalcPartitionProbability(), G4LinLogInterpolation::Calculate(), G4LinLogInterpolation::Calculate(), G4ecpssrBaseKxsModel::CalculateCrossSection(), G4ecpssrBaseLixsModel::CalculateL1CrossSection(), G4OrlicLiXsModel::CalculateL1CrossSection(), G4ecpssrBaseLixsModel::CalculateL2CrossSection(), G4OrlicLiXsModel::CalculateL2CrossSection(), G4ecpssrBaseLixsModel::CalculateL3CrossSection(), G4OrlicLiXsModel::CalculateL3CrossSection(), G4PreCompoundTransitions::CalculateProbability(), G4Reggeons::CalculateXs(), G4LightIonQMDCollision::CalFinalStateOfTheBinaryCollisionJQMD(), G4QMDCollision::CalFinalStateOfTheBinaryCollisionJQMD(), G4Reggeons::Chi_pomeron(), G4Reggeons::Chi_reggeon(), G4NucleiModel::choosePointAlongTraj(), G4Nucleus::Cinema(), G4Clebsch::ClebschGordanCoeff(), G4KalbachCrossSection::ComputeCrossSection(), G4GammaConversionToMuons::ComputeCrossSectionPerAtom(), G4KleinNishinaCompton::ComputeCrossSectionPerAtom(), G4KleinNishinaModel::ComputeCrossSectionPerAtom(), G4PenelopeGammaConversionModel::ComputeCrossSectionPerAtom(), G4PenelopePhotoElectricModel::ComputeCrossSectionPerAtom(), G4PenelopeRayleighModel::ComputeCrossSectionPerAtom(), G4PenelopeRayleighModelMI::ComputeCrossSectionPerAtom(), G4AnnihiToMuPair::ComputeCrossSectionPerElectron(), G4MuBetheBlochModel::ComputeCrossSectionPerElectron(), G4eDPWAElasticDCS::ComputeCSPerAtom(), G4KokoulinMuonNuclearXS::ComputeDDMicroscopicCrossSection(), G4MuBetheBlochModel::ComputeDEDXPerVolume(), G4MuonToMuonPairProductionModel::ComputeDMicroscopicCrossSection(), G4MuPairProductionModel::ComputeDMicroscopicCrossSection(), G4LivermoreBremsstrahlungModel::ComputeDXSectionPerAtom(), G4GoudsmitSaundersonMscModel::ComputeGeomPathLength(), G4UrbanAdjointMscModel::ComputeGeomPathLength(), G4UrbanMscModel::ComputeGeomPathLength(), G4WentzelVIModel::ComputeGeomPathLength(), G4MuBremsstrahlungModel::ComputeMicroscopicCrossSection(), G4MuPairProductionModel::ComputeMicroscopicCrossSection(), G4EvaporationProbability::ComputeProbability(), G4UrbanAdjointMscModel::ComputeTheta0(), G4UrbanMscModel::ComputeTheta0(), G4UrbanAdjointMscModel::ComputeTrueStepLength(), G4UrbanMscModel::ComputeTrueStepLength(), G4RToEConvForElectron::ComputeValue(), G4RToEConvForGamma::ComputeValue(), G4RToEConvForPositron::ComputeValue(), G4MuPairProductionModel::ComputMuPairLoss(), G4DiffractiveExcitation::CreateStrings(), G4LowEXsection::CrossSection(), G4XpimNTotal::CrossSection(), G4XpipNTotal::CrossSection(), G4DNABornIonisationModel1::CrossSectionPerVolume(), G4DNABornIonisationModel2::CrossSectionPerVolume(), G4MuonToMuonPairProductionModel::DataCorrupted(), G4MuPairProductionModel::DataCorrupted(), G4PreCompoundModel::DeExcite(), G4EquilibriumEvaporator::deExcite(), G4FissionParameters::DefineParameters(), G4EmCorrections::DensityCorrection(), G4AtimaFluctuations::Dispersion(), G4PenelopeRayleighModel::DumpFormFactorTable(), G4PenelopeRayleighModelMI::DumpFormFactorTable(), G4ionEffectiveCharge::EffectiveCharge(), G4FissionProbability::EmissionProbability(), G4PhysicsFreeVector::EnableLogBinSearch(), epsilon(), G4LegendrePolynomial::EvalAssocLegendrePoly(), G4Nucleus::EvaporationEffects(), G4Pow::expA(), G4ecpssrBaseKxsModel::ExpIntFunction(), G4ecpssrBaseLixsModel::ExpIntFunction(), G4QuasiElRatios::FetchElTot(), G4HadXSHelper::FillPeaksStructure(), G4NucleiModel::fillZoneRadii(), G4EmUtility::FindCrossSectionMax(), G4HadXSHelper::FindCrossSectionMax(), G4DNASmoluchowskiReactionModel::FindReaction(), G4JTPolynomialSolver::FindRoots(), G4AtimaEnergyLossModel::G4AtimaEnergyLossModel(), G4AtimaFluctuations::G4AtimaFluctuations(), G4InuclSpecialFunctions::G4cbrt(), G4ElasticHadrNucleusHE::G4ElasticHadrNucleusHE(), G4LightIonQMDGroundStateNucleus::G4LightIonQMDGroundStateNucleus(), 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(), G4AtomicFormFactor::Get(), G4ParticleHPInterpolator::GetBinIntegral(), 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(), G4PhotonEvaporation::GetEmissionProbability(), G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy(), G4ElectroNuclearCrossSection::GetEquivalentPhotonQ2(), G4NuclNuclDiffuseElastic::GetErfComp(), G4ChipsAntiBaryonElasticXS::GetExchangeT(), G4ChipsHyperonElasticXS::GetExchangeT(), G4ChipsPionMinusElasticXS::GetExchangeT(), G4ChipsPionPlusElasticXS::GetExchangeT(), G4NuclNuclDiffuseElastic::GetExpCos(), G4hhElastic::GetExpRatioF123(), G4NuclNuclDiffuseElastic::GetExpSin(), G4PenelopeCrossSection::GetHardCrossSection(), G4MicroElecCapture::GetMeanFreePath(), G4PenelopeCrossSection::GetNormalizedShellCrossSection(), G4HyperNucleiProperties::GetNuclearMass(), G4Reggeons::GetProbabilities(), G4FTFParameters::GetProcProb(), G4NuclearFermiDensity::GetRadius(), G4NuclearFermiDensity::GetRelativeDensity(), G4NuclearShellModelDensity::GetRelativeDensity(), G4PenelopeCrossSection::GetShellCrossSection(), G4PenelopePhotoElectricModel::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(), G4eDPWAElasticDCS::InitSCPCorrection(), G4GoudsmitSaundersonTable::InitSCPCorrection(), G4ParticleHPVector::Integrate(), G4LEPTSDiffXS::InterpolateCDXS(), G4Bessel::K0(), G4Bessel::K1(), G4ParticleHPKallbachMannSyst::Kallbach(), G4HadronNucleonXsc::KaonNucleonXscVG(), G4MuPairProductionModel::MakeSamplingTables(), MCGIDI_KalbachMann_sampleEp(), G4Reggeons::ncPomerons(), G4DiffuseElastic::NeutronTuniform(), G4DiffuseElasticV2::NeutronTuniform(), nf_amc_factorial(), nf_exponentialIntegral(), nf_incompleteGammaFunction(), nf_incompleteGammaFunctionComplementary(), G4PenelopeCrossSection::NormalizeShellCrossSections(), G4Bessel::pI0(), G4Bessel::pI1(), G4GammaConversionToMuons::PostStepDoIt(), G4PenelopeBremsstrahlungAngular::PrepareTables(), G4IonDEDXHandler::PrintDEDXTable(), G4IonParametrisedLossModel::PrintDEDXTable(), G4NuclNuclDiffuseElastic::ProfileFar(), G4NuclNuclDiffuseElastic::ProfileNear(), ptwXY_createGaussianCenteredSigma1(), ptwXY_exp(), ptwXY_interpolatePoint(), ptwXY_thicken(), G4NuclearRadii::RadiusHNGG(), G4NuclearRadii::RadiusNNGG(), G4XrayReflection::Reflectivity(), G4Generator2BN::SampleDirection(), G4PenelopeBremsstrahlungAngular::SampleDirection(), G4RayleighAngularGenerator::SampleDirection(), G4eIonisationSpectrum::SampleEnergy(), G4VEmissionProbability::SampleEnergy(), G4SBBremTable::SampleEnergyTransfer(), G4PenelopeBremsstrahlungFS::SampleGammaEnergy(), G4PolarizationTransition::SampleGammaTransition(), G4AntiNuclElastic::SampleInvariantT(), G4HadronElastic::SampleInvariantT(), G4GoudsmitSaundersonMscModel::SampleMSC(), G4VLongitudinalStringDecay::SampleQuarkPt(), G4WentzelVIModel::SampleScattering(), G4BetheHeitler5DModel::SampleSecondaries(), G4BoldyshevTripletModel::SampleSecondaries(), G4eBremParametrizedModel::SampleSecondaries(), G4eBremsstrahlungRelModel::SampleSecondaries(), G4eeToTwoGammaModel::SampleSecondaries(), G4eplusTo2GammaOKVIModel::SampleSecondaries(), G4KleinNishinaCompton::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4LivermoreBremsstrahlungModel::SampleSecondaries(), G4LivermoreComptonModel::SampleSecondaries(), G4LivermoreNuclearGammaConversionModel::SampleSecondaries(), G4LivermorePolarizedComptonModel::SampleSecondaries(), G4LivermorePolarizedGammaConversionModel::SampleSecondaries(), G4LowEPComptonModel::SampleSecondaries(), G4LowEPPolarizedComptonModel::SampleSecondaries(), G4MuBremsstrahlungModel::SampleSecondaries(), G4MuonToMuonPairProductionModel::SampleSecondaries(), G4MuPairProductionModel::SampleSecondaries(), G4PenelopeComptonModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), G4WentzelOKandVIxSection::SampleSingleScattering(), G4ChargeExchange::SampleT(), G4GoudsmitSaundersonTable::Sampling(), G4IonCoulombCrossSection::SetupTarget(), G4hICRU49He::StoppingPower(), G4ePairProduction::StreamProcessInfo(), G4EvaporationProbability::TotalProbability(), G4Clebsch::TriangleCoeff(), G4MuonToMuonPairProductionModel::U_func(), G4Clebsch::Wigner6J(), G4Clebsch::WignerLittleD(), G4NucleiModel::zoneIntegralGaussian(), and G4NucleiModel::zoneIntegralWoodsSaxon().

◆ G4Expf()

G4float G4Expf ( G4float initial_x)
inline

Exponential Function single precision.

Definition at line 227 of file G4Exp.hh.

228{
229 G4float x = initial_x;
230
231 G4float z =
233 0.5f); /* std::floor() truncates toward -infinity. */
234
235 x -= z * G4ExpConsts::C1F;
236 x -= z * G4ExpConsts::C2F;
237 const int32_t n = int32_t(z);
238
239 const G4float x2 = x * x;
240
241 z = x * G4ExpConsts::PX1expf;
243 z *= x;
245 z *= x;
247 z *= x;
249 z *= x;
251 z *= x2;
252 z += x + 1.0f;
253
254 /* multiply by power of 2 */
255 z *= G4ExpConsts::uint322sp((n + 0x7f) << 23);
256
257 if(initial_x > G4ExpConsts::MAXLOGF)
258 z = std::numeric_limits<G4float>::infinity();
259 if(initial_x < G4ExpConsts::MINLOGF)
260 z = 0.f;
261
262 return z;
263}
float G4float
Definition G4Types.hh:84
const G4float C1F
Definition G4Exp.hh:88
const G4float PX1expf
Definition G4Exp.hh:91
const G4float LOG2EF
Definition G4Exp.hh:98
const G4float PX6expf
Definition G4Exp.hh:96
G4float uint322sp(G4int x)
Definition G4Exp.hh:131
const G4float PX4expf
Definition G4Exp.hh:94
const G4float MINLOGF
Definition G4Exp.hh:86
const G4float PX3expf
Definition G4Exp.hh:93
const G4float MAXLOGF
Definition G4Exp.hh:85
const G4float PX5expf
Definition G4Exp.hh:95
const G4float PX2expf
Definition G4Exp.hh:92
const G4float C2F
Definition G4Exp.hh:89

◆ 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 )