Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-08-19 01:41:13

0001 #ifndef CalibGBRMATH
0002 #define CalibGBRMATH
0003 
0004 #include "RVersion.h"
0005 #if ROOT_VERSION_CODE >= ROOT_VERSION(5, 34, 00)
0006 #include "vdt/vdtMath.h"
0007 #else
0008 #include "DataFormats/Math/interface/VDTMath.h"
0009 #endif
0010 
0011 #include <cmath>
0012 
0013 namespace gbrmath {
0014   inline double fast_pow(double base, double exponent) {
0015     if (base == 0. && exponent > 0.)
0016       return 0.;
0017     else if (base > 0.)
0018       return vdt::fast_exp(exponent * vdt::fast_log(base));
0019     else
0020       return std::nan("");
0021   }
0022 }  // namespace gbrmath
0023 
0024 #endif