ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigBjetHypo
src
safeLogRatio.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigBjetHypo/safeLogRatio.h
"
6
7
#include <cmath>
8
#include <limits>
9
10
float
safeLogRatio
(
float
num,
float
denom) {
11
// ep(silon) is the smallest non-subnormal number
12
// the recyprocal of this should not overflow
13
float
ep = std::numeric_limits<float>::min();
14
float
ratio = (std::abs(denom) < ep ? INFINITY : num / denom);
15
return
std::abs(ratio) < ep ? -INFINITY : std::log( ratio );
16
}
safeLogRatio
float safeLogRatio(float num, float denom)
Definition
safeLogRatio.cxx:10
safeLogRatio.h
Generated on
for ATLAS Offline Software by
1.14.0