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

Go to the source code of this file.

Classes

union  G4LogConsts::ieee754
 

Namespaces

namespace  G4LogConsts
 

Functions

G4double G4LogConsts::get_log_px (const G4double x)
 
G4double G4LogConsts::get_log_qx (const G4double x)
 
uint64_t G4LogConsts::dp2uint64 (G4double x)
 
G4double G4LogConsts::uint642dp (uint64_t ll)
 
G4float G4LogConsts::uint322sp (G4int x)
 
uint32_t G4LogConsts::sp2uint32 (G4float x)
 
G4double G4LogConsts::getMantExponent (const G4double x, G4double &fe)
 Like frexp but vectorising and the exponent is a double.
 
G4float G4LogConsts::getMantExponentf (const G4float x, G4float &fe)
 Like frexp but vectorising and the exponent is a float.
 
G4double G4Log (G4double x)
 
G4float G4LogConsts::get_log_poly (const G4float x)
 
G4float G4Logf (G4float x)
 
void logv (const uint32_t size, G4double const *__restrict__ iarray, G4double *__restrict__ oarray)
 
void G4Logv (const uint32_t size, G4double const *__restrict__ iarray, G4double *__restrict__ oarray)
 
void logfv (const uint32_t size, G4float const *__restrict__ iarray, G4float *__restrict__ oarray)
 
void G4Logfv (const uint32_t size, G4float const *__restrict__ iarray, G4float *__restrict__ oarray)
 

Variables

const G4double G4LogConsts::LOG_UPPER_LIMIT = 1e307
 
const G4double G4LogConsts::LOG_LOWER_LIMIT = 0
 
const G4double G4LogConsts::SQRTH = 0.70710678118654752440
 
const G4float G4LogConsts::MAXNUMF = 3.4028234663852885981170418348451692544e38f
 
const G4float G4LogConsts::LOGF_UPPER_LIMIT = MAXNUMF
 
const G4float G4LogConsts::LOGF_LOWER_LIMIT = 0
 
const G4float G4LogConsts::PX1logf = 7.0376836292E-2f
 
const G4float G4LogConsts::PX2logf = -1.1514610310E-1f
 
const G4float G4LogConsts::PX3logf = 1.1676998740E-1f
 
const G4float G4LogConsts::PX4logf = -1.2420140846E-1f
 
const G4float G4LogConsts::PX5logf = 1.4249322787E-1f
 
const G4float G4LogConsts::PX6logf = -1.6668057665E-1f
 
const G4float G4LogConsts::PX7logf = 2.0000714765E-1f
 
const G4float G4LogConsts::PX8logf = -2.4999993993E-1f
 
const G4float G4LogConsts::PX9logf = 3.3333331174E-1f
 
const G4float G4LogConsts::SQRTHF = 0.707106781186547524f
 

Function Documentation

◆ G4Log()

G4double G4Log ( G4double x)
inline

Definition at line 227 of file G4Log.hh.

228{
229 const G4double original_x = x;
230
231 /* separate mantissa from exponent */
232 G4double fe;
234
235 // blending
236 x > G4LogConsts::SQRTH ? fe += 1. : x += x;
237 x -= 1.0;
238
239 /* rational form */
241
242 // for the final formula
243 const G4double x2 = x * x;
244 px *= x;
245 px *= x2;
246
247 const G4double qx = G4LogConsts::get_log_qx(x);
248
249 G4double res = px / qx;
250
251 res -= fe * 2.121944400546905827679e-4;
252 res -= 0.5 * x2;
253
254 res = x + res;
255 res += fe * 0.693359375;
256
257 if(original_x > G4LogConsts::LOG_UPPER_LIMIT)
258 res = std::numeric_limits<G4double>::infinity();
259 if(original_x < G4LogConsts::LOG_LOWER_LIMIT) // THIS IS NAN!
260 res = -std::numeric_limits<G4double>::quiet_NaN();
261
262 return res;
263}
G4fissionEvent * fe
double G4double
Definition G4Types.hh:83
G4double get_log_px(const G4double x)
Definition G4Log.hh:99
const G4double LOG_LOWER_LIMIT
Definition G4Log.hh:76
const G4double LOG_UPPER_LIMIT
Definition G4Log.hh:75
G4double getMantExponent(const G4double x, G4double &fe)
Like frexp but vectorising and the exponent is a double.
Definition G4Log.hh:185
G4double get_log_qx(const G4double x)
Definition G4Log.hh:122
const G4double SQRTH
Definition G4Log.hh:78

Referenced by G4PenelopeCrossSection::AddCrossSectionPoint(), G4PenelopeCrossSection::AddShellCrossSectionPoint(), G4BaierKatkov::AddStatisticsInPhotonEnergyRegion(), G4VAtomDeexcitation::AlongStepDeexcitation(), G4TransportationWithMsc::AlongStepGetPhysicalInteractionLength(), G4Nucleus::AnnihilationEvaporationEffects(), G4LFission::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4ParticleHPFissionFS::ApplyYourself(), G4EnergyLossForExtrapolator::AverageScatteringAngle(), G4EmCorrections::BarkasCorrection(), G4EmCorrections::Bethe(), G4EmTableUtil::BuildLambdaTable(), G4EmTableUtil::BuildLambdaTable(), G4VEmProcess::BuildLambdaTable(), G4VEnergyLossProcess::BuildLambdaTable(), G4GammaGeneralProcess::BuildPhysicsTable(), G4NeutronGeneralProcess::BuildPhysicsTable(), G4TransportationWithMsc::BuildPhysicsTable(), G4PenelopeBremsstrahlungFS::BuildScaledXSTable(), G4StatMFMacroBiNucleon::CalcEntropy(), G4StatMFMacroMultiNucleon::CalcEntropy(), G4StatMFMacroNucleon::CalcEntropy(), G4StatMFMacroTetraNucleon::CalcEntropy(), G4StatMFMacroTriNucleon::CalcEntropy(), G4StatMFMicroPartition::CalcPartitionProbability(), G4PreCompoundTransitions::CalculateProbability(), G4LightIonQMDCollision::CalFinalStateOfTheBinaryCollisionJQMD(), G4QMDCollision::CalFinalStateOfTheBinaryCollisionJQMD(), G4QuasiElRatios::ChExElCoef(), G4Reggeons::Chi_pomeron(), G4Reggeons::Chi_reggeon(), G4Nucleus::Cinema(), G4PolarizedComptonModel::ComputeAsymmetryPerAtom(), G4BetheHeitlerModel::ComputeCrossSectionPerAtom(), G4GammaConversionToMuons::ComputeCrossSectionPerAtom(), G4KleinNishinaCompton::ComputeCrossSectionPerAtom(), G4KleinNishinaModel::ComputeCrossSectionPerAtom(), G4PenelopeGammaConversionModel::ComputeCrossSectionPerAtom(), G4PenelopePhotoElectricModel::ComputeCrossSectionPerAtom(), G4PenelopeRayleighModel::ComputeCrossSectionPerAtom(), G4PenelopeRayleighModelMI::ComputeCrossSectionPerAtom(), G4UrbanAdjointMscModel::ComputeCrossSectionPerAtom(), G4UrbanMscModel::ComputeCrossSectionPerAtom(), G4AtimaEnergyLossModel::ComputeCrossSectionPerElectron(), G4BetheBlochModel::ComputeCrossSectionPerElectron(), G4BraggModel::ComputeCrossSectionPerElectron(), G4eeToTwoGammaModel::ComputeCrossSectionPerElectron(), G4eplusTo2GammaOKVIModel::ComputeCrossSectionPerElectron(), G4eplusTo3GammaOKVIModel::ComputeCrossSectionPerElectron(), G4ICRU73QOModel::ComputeCrossSectionPerElectron(), G4MollerBhabhaModel::ComputeCrossSectionPerElectron(), G4MuBetheBlochModel::ComputeCrossSectionPerElectron(), G4ComponentGGHadronNucleusXsc::ComputeCrossSections(), G4eDPWAElasticDCS::ComputeCSPerAtom(), G4KokoulinMuonNuclearXS::ComputeDDMicroscopicCrossSection(), G4BetheBlochModel::ComputeDEDXPerVolume(), G4BraggIonModel::ComputeDEDXPerVolume(), G4BraggModel::ComputeDEDXPerVolume(), G4ICRU73QOModel::ComputeDEDXPerVolume(), G4MollerBhabhaModel::ComputeDEDXPerVolume(), G4MuBetheBlochModel::ComputeDEDXPerVolume(), G4hBremsstrahlungModel::ComputeDMicroscopicCrossSection(), G4MuBremsstrahlungModel::ComputeDMicroscopicCrossSection(), G4MuonToMuonPairProductionModel::ComputeDMicroscopicCrossSection(), G4MuPairProductionModel::ComputeDMicroscopicCrossSection(), G4LivermoreBremsstrahlungModel::ComputeDXSectionPerAtom(), G4eplusTo3GammaOKVIModel::ComputeF(), G4eplusTo3GammaOKVIModel::ComputeF0(), G4UrbanAdjointMscModel::ComputeGeomPathLength(), G4UrbanMscModel::ComputeGeomPathLength(), G4MuBremsstrahlungModel::ComputeMicroscopicCrossSection(), G4MuPairProductionModel::ComputeMicroscopicCrossSection(), G4PairProductionRelModel::ComputeParametrizedXSectionPerAtom(), G4PairProductionRelModel::ComputePhi12(), G4eDPWAElasticDCS::ComputeScatteringPowerCorrection(), G4GoudsmitSaundersonTable::ComputeScatteringPowerCorrection(), G4UrbanAdjointMscModel::ComputeTheta0(), G4UrbanMscModel::ComputeTheta0(), G4WentzelOKandVIxSection::ComputeTransportCrossSectionPerAtom(), G4GoudsmitSaundersonMscModel::ComputeTruePathLengthLimit(), G4UrbanAdjointMscModel::ComputeTruePathLengthLimit(), G4UrbanMscModel::ComputeTruePathLengthLimit(), G4GoudsmitSaundersonMscModel::ComputeTrueStepLength(), G4UrbanAdjointMscModel::ComputeTrueStepLength(), G4UrbanMscModel::ComputeTrueStepLength(), G4WentzelVIModel::ComputeTrueStepLength(), G4RToEConvForElectron::ComputeValue(), G4RToEConvForGamma::ComputeValue(), G4RToEConvForPositron::ComputeValue(), G4MuPairProductionModel::ComputMuPairLoss(), G4LindhardSorensenIonModel::CorrectionsAlongStep(), G4NuclNuclDiffuseElastic::CoulombAmplitude(), G4VChannelingFastSimCrystalData::CoulombAtomicScattering(), G4VChannelingFastSimCrystalData::CoulombElectronScattering(), G4DiffractiveExcitation::CreateStrings(), G4AngularDistribution::Cross(), G4LowEXsection::CrossSection(), G4XPDGElastic::CrossSection(), G4XpimNTotal::CrossSection(), G4XpipNTotal::CrossSection(), G4DNADingfelderChargeIncreaseModel::CrossSectionPerVolume(), G4GoudsmitSaundersonMscModel::CrossSectionPerVolume(), G4EmCorrections::DensityCorrection(), G4AtimaFluctuations::Dispersion(), G4ionEffectiveCharge::EffectiveCharge(), G4PhysicsFreeVector::EnableLogBinSearch(), G4LegendrePolynomial::EvalAssocLegendrePoly(), G4Nucleus::EvaporationEffects(), G4QuasiElRatios::FetchElTot(), G4HadXSHelper::FillPeaksStructure(), G4NucleiModel::fillZoneRadii(), G4EmUtility::FindCrossSectionMax(), G4HadXSHelper::FindCrossSectionMax(), G4JTPolynomialSolver::FindRoots(), G4InuclSpecialFunctions::G4cbrt(), G4ElasticHadrNucleusHE::G4ElasticHadrNucleusHE(), G4F20GEMProbability::G4F20GEMProbability(), G4GSMottCorrection::G4GSMottCorrection(), G4GSPWACorrections::G4GSPWACorrections(), G4NeutronCaptureXS::G4NeutronCaptureXS(), G4O17GEMProbability::G4O17GEMProbability(), G4PenelopeRayleighModel::G4PenelopeRayleighModel(), G4PenelopeRayleighModelMI::G4PenelopeRayleighModelMI(), G4FPYSamplingOps::G4SampleWatt(), G4XNNElasticLowE::G4XNNElasticLowE(), G4XnpElasticLowE::G4XnpElasticLowE(), G4XnpTotalLowE::G4XnpTotalLowE(), G4NuclNuclDiffuseElastic::GammaLogB2n(), G4eeToHadronsModel::GenerateCMPhoton(), G4NucleiModel::generateInteractionLength(), G4ComponentAntiNuclNuclearXS::GetAntiHadronNucleonElCrSc(), G4ComponentAntiNuclNuclearXS::GetAntiHadronNucleonTotCrSc(), G4hhElastic::GetAQQ(), G4hhElastic::GetAqq(), G4ParticleHPInterpolator::GetBinIntegral(), G4QuasiElRatios::GetChExFactor(), G4DNAQuinnPlasmonExcitationModel::GetCrossSection(), G4VEmProcess::GetCrossSection(), G4LindhardSorensenData::GetDeltaL(), G4IonisParamMat::GetDensityCorrection(), G4PenelopeIonisationXSHandler::GetDensityCorrection(), G4DNARelativisticIonisationModel::GetDifferentialCrossSection(), G4ElectroNuclearCrossSection::GetElementCrossSection(), G4PhotoNuclearCrossSection::GetElementCrossSection(), G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy(), G4ElectroNuclearCrossSection::GetEquivalentPhotonQ2(), G4ChipsAntiBaryonElasticXS::GetExchangeT(), G4ChipsHyperonElasticXS::GetExchangeT(), G4ChipsPionMinusElasticXS::GetExchangeT(), G4ChipsPionPlusElasticXS::GetExchangeT(), G4RKFieldIntegrator::GetExcitationEnergy(), G4DNADiracRMatrixExcitationModel::GetExtendedPartialCrossSection(), G4GoudsmitSaundersonTable::GetGSAngularDtr(), G4NuclNuclDiffuseElastic::GetHadronNucleonXscNS(), G4PenelopeCrossSection::GetHardCrossSection(), G4ComponentAntiNuclNuclearXS::GetInelasticElementCrossSection(), G4ChargeExchangeXS::GetIsoCrossSection(), G4PhotoNuclearCrossSection::GetIsoCrossSection(), G4ParticleHPKallbachMannSyst::GetKallbachZero(), G4PenelopeBremsstrahlungFS::GetMomentumIntegral(), G4PenelopeCrossSection::GetNormalizedShellCrossSection(), G4DNARelativisticIonisationModel::GetPartialCrossSection(), G4NuclearFermiDensity::GetRadius(), G4NuclearShellModelDensity::GetRadius(), G4PenelopeCrossSection::GetShellCrossSection(), G4PenelopePhotoElectricModel::GetShellCrossSection(), G4PenelopeCrossSection::GetSoftStoppingPower(), G4DiffusionControlledReactionModel::GetTimeToEncounter(), G4PenelopeCrossSection::GetTotalCrossSection(), G4ComponentAntiNuclNuclearXS::GetTotalElementCrossSection(), G4GoudsmitSaundersonMscModel::GetTransportMeanFreePath(), G4ElectroNuclearCrossSection::GetVirtualFactor(), G4ParticleHPInterpolator::GetWeightedBinIntegral(), G4HadronNucleonXsc::HadronNucleonXscEL(), G4HadronNucleonXsc::HadronNucleonXscNS(), G4HadronNucleonXsc::HadronNucleonXscPDG(), G4HadronNucleonXsc::HadronNucleonXscVU(), G4FTFParameters::InitForInteraction(), G4BoldyshevTripletModel::Initialise(), G4GoudsmitSaundersonTable::Initialise(), G4mplIonisationModel::Initialise(), G4mplIonisationWithDeltaModel::Initialise(), G4MuPairProductionModel::Initialise(), G4PhysicsLogVector::Initialise(), G4EmUtility::InitialiseElementSelectors(), G4NucleiModel::initializeCascad(), G4eDPWAElasticDCS::InitSCPCorrection(), G4GoudsmitSaundersonTable::InitSCPCorrection(), G4ParticleHPVector::Integrate(), G4SynchrotronRadiation::InvSynFracInt(), G4VChannelingFastSimCrystalData::IonizationLosses(), G4Bessel::K0(), G4Bessel::K1(), G4HadronNucleonXsc::KaonNucleonXscVG(), G4Pow::logX(), G4MuPairProductionModel::MakeSamplingTables(), MCGIDI_KalbachMann_sampleEp(), MCGIDI_outputChannel_sampleProductsAtE(), MCGIDI_sampling_interpolationValues(), MCGIDI_sampling_sampleX_from_pdfsOfXGivenW(), nf_exponentialIntegral(), nf_incompleteGammaFunction(), nf_incompleteGammaFunctionComplementary(), G4PenelopeCrossSection::NormalizeShellCrossSections(), G4NuclNuclDiffuseElastic::PhaseFar(), G4NuclNuclDiffuseElastic::PhaseNear(), G4Bessel::pK0(), G4hhElastic::Pomeron(), G4GammaConversionToMuons::PostStepDoIt(), G4GammaGeneralProcess::PostStepGetPhysicalInteractionLength(), G4HadronicProcess::PostStepGetPhysicalInteractionLength(), G4NeutronGeneralProcess::PostStepGetPhysicalInteractionLength(), G4VEmProcess::PostStepGetPhysicalInteractionLength(), G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength(), G4VEnergyLossProcess::PreparePhysicsTable(), G4PenelopeBremsstrahlungAngular::PrepareTables(), G4GeneratorPrecompoundInterface::Propagate(), G4GeneratorPrecompoundInterface::PropagateNuclNucl(), ptwXY_createGaussianCenteredSigma1(), ptwXY_f_integrate(), ptwXY_interpolatePoint(), ptwXY_thicken(), ptwXY_update_biSectionMax(), G4InuclSpecialFunctions::randomGauss(), G4QSS2::recompute_next_times(), G4Generator2BS::RejectionFunction(), G4VProcess::ResetNumberOfInteractionLengthLeft(), G4ParticleHPSimpleEvapSpectrum::Sample(), G4ParticleHPWattSpectrum::Sample(), G4DeltaAngle::SampleDirection(), G4RayleighAngularGenerator::SampleDirection(), G4VEmissionProbability::SampleEnergy(), G4UniversalFluctuation::SampleFluctuations(), G4FPYSamplingOps::SampleGaussian(), G4UniversalFluctuation::SampleGlandz(), G4UrbanFluctuation::SampleGlandz(), G4AntiNuclElastic::SampleInvariantT(), G4HadronElastic::SampleInvariantT(), G4GoudsmitSaundersonMscModel::SampleMSC(), G4NeutrinoNucleusModel::SampleQkr(), G4VLongitudinalStringDecay::SampleQuarkPt(), G4KineticTrack::SampleResidualLifetime(), 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(), G4MuBetheBlochModel::SampleSecondaries(), G4MuBremsstrahlungModel::SampleSecondaries(), G4MuonToMuonPairProductionModel::SampleSecondaries(), G4MuPairProductionModel::SampleSecondaries(), G4PenelopeComptonModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), G4ChargeExchange::SampleT(), G4LMsdGenerator::SampleT(), G4NeutrinoNucleusModel::SampleXkr(), G4BetheHeitlerModel::ScreenFunction1(), G4PairProductionRelModel::ScreenFunction1(), G4BetheHeitlerModel::ScreenFunction12(), G4PairProductionRelModel::ScreenFunction12(), G4BetheHeitlerModel::ScreenFunction2(), G4PairProductionRelModel::ScreenFunction2(), G4IonisParamMat::SetDensityEffectParameters(), G4VEnergyLossProcess::SetDynamicMassCharge(), G4VEmProcess::SetMaxKinEnergy(), G4IonisParamMat::SetMeanExcitationEnergy(), G4VEmProcess::SetMinKinEnergy(), G4BaierKatkov::SetSpectrumEnergyRange(), G4IonCoulombCrossSection::SetupTarget(), G4EmCorrections::ShellCorrectionSTD(), G4VEnergyLossProcess::StartTracking(), G4EnergyLossForExtrapolator::TrueStepLength(), G4VelocityTable::Value(), G4Clebsch::WignerLittleD(), and G4NucleiModel::zoneIntegralWoodsSaxon().

◆ G4Logf()

G4float G4Logf ( G4float x)
inline

Definition at line 308 of file G4Log.hh.

309{
310 const G4float original_x = x;
311
312 G4float fe;
314
315 x > G4LogConsts::SQRTHF ? fe += 1.f : x += x;
316 x -= 1.0f;
317
318 const G4float x2 = x * x;
319
321 res *= x2 * x;
322
323 res += -2.12194440e-4f * fe;
324 res += -0.5f * x2;
325
326 res = x + res;
327
328 res += 0.693359375f * fe;
329
330 if(original_x > G4LogConsts::LOGF_UPPER_LIMIT)
331 res = std::numeric_limits<G4float>::infinity();
332 if(original_x < G4LogConsts::LOGF_LOWER_LIMIT)
333 res = -std::numeric_limits<G4float>::quiet_NaN();
334
335 return res;
336}
float G4float
Definition G4Types.hh:84
G4float getMantExponentf(const G4float x, G4float &fe)
Like frexp but vectorising and the exponent is a float.
Definition G4Log.hh:210
const G4float LOGF_UPPER_LIMIT
Definition G4Log.hh:269
const G4float LOGF_LOWER_LIMIT
Definition G4Log.hh:270
G4float get_log_poly(const G4float x)
Definition G4Log.hh:282
const G4float SQRTHF
Definition G4Log.hh:303

◆ G4Logfv()

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

◆ G4Logv()

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

◆ logfv()

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

◆ logv()

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