Alexander Voigt
2010-07-20 18:41:27 UTC
Dear ROOT developers,
I would like to make a suggestion for an improvement within the TMath class.
Physicists working with ROOT make heavy use of mathematics functions in
TMath. Often they want to calculate powers with an integer exponent and
are therefore doing things like
TMath::Power(x, 2)
According to this ATLAS recommendation
https://twiki.cern.ch/twiki/bin/view/Atlas/CalculatingIntegerPowers
one should always use std::pow() for these purposes (#include <cmath>),
because of a factor 10 in performance gain.
For this reason I propose the implementation of a function
Double_t TMath::Power(Double_t, Int_t)
which simply encapsulates
double std::pow( double, int );
or
long double std::pow( long double, int );
from the cmath module of the C++ standard library.
Many thanks in advance,
Alexander Voigt
I would like to make a suggestion for an improvement within the TMath class.
Physicists working with ROOT make heavy use of mathematics functions in
TMath. Often they want to calculate powers with an integer exponent and
are therefore doing things like
TMath::Power(x, 2)
According to this ATLAS recommendation
https://twiki.cern.ch/twiki/bin/view/Atlas/CalculatingIntegerPowers
one should always use std::pow() for these purposes (#include <cmath>),
because of a factor 10 in performance gain.
For this reason I propose the implementation of a function
Double_t TMath::Power(Double_t, Int_t)
which simply encapsulates
double std::pow( double, int );
or
long double std::pow( long double, int );
from the cmath module of the C++ standard library.
Many thanks in advance,
Alexander Voigt