a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
ClausenFunctions.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 HEPfit Collaboration
3 *
4 *
5 * For the licensing terms see doc/COPYING.
6 */
7
8#include <cstdlib>
9#include <stdexcept>
10#include <cmath>
11#include <gsl/gsl_sf.h>
12#include "ClausenFunctions.h"
13
14
16{
17}
18
20
21double ClausenFunctions::Cl2(const double phi) const
22{
23 return ( gsl_sf_clausen(phi) );
24}
25
26double ClausenFunctions::Cl3(const double phi) const
27{
28 auto myphi = remainder(phi, 2.0 * M_PI); // reduce phi to the range [-pi, pi]
29 if (myphi < 0.0) myphi = -myphi; // Clausen function of third order is even, so we can use the positive value
30
31 if (myphi==0.0) return ( gsl_sf_zeta_int(3) );
32
33 double TMP = 0.0, l_double = 0.0, lfactorial = 1.0, sign = 1.0;
34 for (int l=2; l<19; l++) {
35 l_double = (double)l;
36 lfactorial *= l_double;
37 if (l%4) { sign = - 1.0; } else { sign = 1.0; }
38 TMP += B[l]*pow(myphi,l_double)/l_double/(l_double + 1.0)/(l_double + 2.0)
39 /lfactorial * sign;
40 }
41 return ( gsl_sf_zeta_int(3) - myphi*myphi*(3.0/4.0 - log(myphi)/2.0 - TMP) );
42}
43
44
double B[19]
the Bernoulli numbers
ClausenFunctions()
The default constructor.
double Cl3(const double phi) const
The Clausen function of index 3, .
double Cl2(const double phi) const
The Clausen function of index 2, .