CMS 3D CMS Logo

SimplifyLogExp.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_SimplifyLogExp_h
2 #define PhysicsTools_Utilities_SimplifyLogExp_h
3 
11 
13 
14 namespace funct {
15  // log(exp(a)) = a
16  LOG_RULE(TYPT1, EXP_S(A), A, _._);
17 
18  // exp(log(a)) = a
19  EXP_RULE(TYPT1, LOG_S(A), A, _._);
20 
21  // log(a ^ b) = b * log(a)
22  LOG_RULE(TYPT2, POWER_S(A, B), PROD(B, LOG(A)), _._2* log(_._1));
23 
24  // exp(a) * exp(b) = exp(a + b)
25  PROD_RULE(TYPT2, EXP_S(A), EXP_S(B), EXP(SUM(A, B)), exp(_1._ + _2._));
26 
27  // log(a * b) = log(a) + log (b)
28  LOG_RULE(TYPT2, PROD_S(A, B), SUM(LOG(A), LOG(B)), log(_._1) + log(_._2));
29 
30  // log(a / b) = log(a) - log (b)
31  LOG_RULE(TYPT2, RATIO_S(A, B), DIFF(LOG(A), LOG(B)), log(_._1) - log(_._2));
32 
33  // exp(x) * x = x * exp(x)
34  PROD_RULE(TYPT1, EXP_S(A), A, PROD(A, EXP(A)), _2* _1);
35 
36  // log(x) * x = x * log(x)
37  PROD_RULE(TYPT1, LOG_S(A), A, PROD(A, LOG(A)), _2* _1);
38 
39 } // namespace funct
40 
42 
43 #endif
SUM
#define SUM(A, B)
Definition: Simplify_begin.h:52
Product.h
POWER_S
#define POWER_S(A, B)
Definition: Simplify_begin.h:41
Ratio.h
funct::PROD_S
PROD_S(B, C)>
Definition: Factorize.h:114
funct::B
TEMPL(T2) struct Divides B
Definition: Factorize.h:24
funct::DIFF
typedef DIFF(PROD(A, B1), PRIMIT(X, PROD(A1, B1))) type
LOG_S
#define LOG_S(A)
Definition: Simplify_begin.h:45
RATIO_S
#define RATIO_S(A, B)
Definition: Simplify_begin.h:40
crabWrapper._
_
Definition: crabWrapper.py:19
Power.h
TYPT1
#define TYPT1
Definition: Simplify_begin.h:6
TYPT2
#define TYPT2
Definition: Simplify_begin.h:7
LOG_RULE
#define LOG_RULE(TMPL, T, RES, COMB)
Definition: Simplify_begin.h:123
Difference.h
Log.h
LOG
#define LOG(A)
Definition: Simplify_begin.h:61
EXP_RULE
#define EXP_RULE(TMPL, T, RES, COMB)
Definition: Simplify_begin.h:116
Sum.h
A
PROD_RULE
#define PROD_RULE(TMPL, T1, T2, RES, COMB)
Definition: Simplify_begin.h:95
funct::exp
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
EXP_S
#define EXP_S(A)
Definition: Simplify_begin.h:44
Exp.h
Simplify_end.h
funct::log
Log< T >::type log(const T &t)
Definition: Log.h:22
EXP
#define EXP(A)
Definition: Simplify_begin.h:60
Simplify_begin.h
funct::PROD
typedef PROD(F, SUM(RATIO(A, F), RATIO(B, F))) type
funct
Definition: Abs.h:5