reduction of std::pow calls; stronger usage of
Cartesian- and CylinderCoordinate objects
This commit is contained in:
@@ -92,7 +92,7 @@ double velocity(double energy_eV, double mass_kg) {
|
||||
}
|
||||
|
||||
double relativisticGamma(const blitz::TinyVector<double, 3>& velocity) {
|
||||
return std::sqrt(1. + blitz::dot(velocity, velocity) / std::pow(SI::c, 2));
|
||||
return std::sqrt(1. + blitz::dot(velocity, velocity) / (SI::c*SI::c));
|
||||
}
|
||||
|
||||
double relativisticGamma(double kin_energy_eV, double mass_eV) {
|
||||
@@ -105,7 +105,8 @@ double relativisticBeta(double velocity_ms) {
|
||||
|
||||
double relativisticBeta(double kin_energy_eV, double mass_eV) {
|
||||
const double gamma = relativisticGamma(kin_energy_eV, mass_eV);
|
||||
return std::sqrt(1 - std::pow(1 / gamma, 2));
|
||||
// return std::sqrt(1 - std::pow(1 / gamma, 2));
|
||||
return std::sqrt(1 - 1 / (gamma*gamma));
|
||||
}
|
||||
|
||||
double relativisticMomentum(double energy_eV, double mass_eV) {
|
||||
|
||||
Reference in New Issue
Block a user