flexiblesusy is hosted by Hepforge, IPPP Durham
FlexibleSUSY
amm_loop_functions.cpp
Go to the documentation of this file.
1// ====================================================================
2// This file is part of FlexibleSUSY.
3//
4// FlexibleSUSY is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published
6// by the Free Software Foundation, either version 3 of the License,
7// or (at your option) any later version.
8//
9// FlexibleSUSY is distributed in the hope that it will be useful, but
10// WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with FlexibleSUSY. If not, see
16// <http://www.gnu.org/licenses/>.
17// ====================================================================
18
20#include "error.hpp"
21#include "Cl2.hpp"
22#include "Li2.hpp"
23#include <cmath>
24#include <limits>
25#include <utility>
26
27namespace flexiblesusy {
28namespace amm_loop_functions {
29namespace two_loop {
30
31namespace {
32
33void sort(double& x, double& y)
34{
35 if (x > y) {
36 std::swap(x, y);
37 }
38}
39
40} // anonymous namespace
41
48double BarrZeeLoopFP(double z)
49{
50 if (z < 0) {
51 throw OutOfBoundsError("BarrZeeLoopFP: argument must not be negative.");
52 } else if (z == 0) {
53 return 0;
54 } else if (z < std::numeric_limits<double>::epsilon()) {
55 constexpr double pi26 = 1.6449340668482264; // Pi^2/6
56 const double lz = std::log(z);
57 return z*(pi26 + 0.5*lz*lz);
58 } else if (z < 0.25) {
59 const double y = std::sqrt(1 - 4*z); // 0 < y < 1
60 constexpr double c = -4.9348022005446793; // -Pi^2/2
61 const double q = (1 + y)/(1 - y);
62 const double lq = std::log(q);
63 return z/y*(2*Li2(1 + q) - lq*(std::log(z) - 0.5*lq) + c);
64 } else if (z == 0.25) {
65 return 0.69314718055994531; // Log[4]
66 }
67
68 // z > 0.25
69 const double y = std::sqrt(-1 + 4*z);
70 const double theta = std::atan2(y, 2*z - 1);
71 return 2*z/y*Cl2(theta);
72}
73
80double BarrZeeLoopFS(double z)
81{
82 if (z < 0) {
83 throw OutOfBoundsError("BarrZeeLoopFS: argument must not be negative.");
84 } else if (z == 0) {
85 return 0;
86 } if (z > 1e2) {
87 const double lz = std::log(z);
88 const double iz = 1/z;
89 return (-13./18 - 1./3*lz) + iz*(-26./300 - 15./300*lz
90 + iz*(-673./44100 - 420./44100*lz + iz*(-971./317520 - 630./317520*lz)));
91 }
92
93 return (2*z - 1)*BarrZeeLoopFP(z) - z*(2 + std::log(z));
94}
95
103double BarrZeeLoopFPZ(double x, double y)
104{
105 if (x < 0 || y < 0) {
106 throw OutOfBoundsError("BarrZeeLoopFPZ: arguments must not be negative.");
107 }
108
109 sort(x, y);
110
111 constexpr double eps = 1e-8;
112
113 if (x == 0 || y == 0) {
114 return 0;
115 } else if (std::abs(1 - x/y) < eps) {
116 if (std::abs(x - 0.25) < eps) {
117 // -(1 + 2*Log[2])/6 + O(x - 1/4)
118 return -0.39771572685331510 - 0.87269032593060833*(x - 0.25);
119 }
120 return x*(2*BarrZeeLoopFP(x) + std::log(x))/(1 - 4*x);
121 }
122
123 return (y*BarrZeeLoopFP(x) - x*BarrZeeLoopFP(y))/(x - y);
124}
125
133double BarrZeeLoopFSZ(double x, double y)
134{
135 if (x < 0 || y < 0) {
136 throw OutOfBoundsError("BarrZeeLoopFSZ: arguments must not be negative.");
137 }
138
139 sort(x, y);
140
141 constexpr double eps = 1e-8;
142
143 if (x == 0 || y == 0) {
144 return 0;
145 } else if (std::abs(1 - x/y) < eps) {
146 if (std::abs(x - 0.25) < eps) {
147 // (-1 + 4*Log[2])/6 + O(x - 1/4)
148 return 0.29543145370663021 + 0.61807097779182499*(x - 0.25);
149 } else if (x >= 1e3) {
150 const double ix = 1/x;
151 const double lx = std::log(x);
152 return 7./18 + 1./3*lx
153 + ix*(37./300 + 1./10*lx
154 + ix*(533./14700 + 1./35*lx
155 + ix*(1627./158760 + 1./126*lx
156 + ix*(18107./6.40332e6 + 1./462*lx))));
157 }
158 return x*(1 - 4*x + 4*x*BarrZeeLoopFP(x) + std::log(x)*(1 - 2*x))/(4*x - 1);
159 }
160
161 return (y*BarrZeeLoopFS(x) - x*BarrZeeLoopFS(y))/(x - y);
162}
163
170double BarrZeeLoopS(double z)
171{
172 if (z < 0) {
173 throw OutOfBoundsError("BarrZeeLoopS: argument must not be negative.");
174 } else if (z == 0) {
175 return 0;
176 }
177
178 return 1 + 0.5*std::log(z) - BarrZeeLoopFP(z);
179}
180
187double BarrZeeLoopV(double z)
188{
189 if (z < 0) {
190 throw OutOfBoundsError("BarrZeeLoopV: argument must not be negative.");
191 } else if (z == 0) {
192 return 0; // actually -inf; return 0 to avoid propagation of inf
193 } if (z >= 1e2) {
194 const double lz = std::log(z);
195 const double iz = 1/z;
196 return 89./12 + 42./12*lz + iz*(284./360 + 165./360*lz
197 + iz*(6199./44100 + 3885./44100*lz
198 + iz*(30017./1.0584e6 + 19530./1.0584e6*lz
199 + iz*(83351./1.37214e7 + 55440./1.37214e7*lz
200 + iz*(34978051./2.597186592e10 + 23603580./2.597186592e10*lz)))));
201 }
202
203 return (17./2 - 15*z)*BarrZeeLoopFP(z) + (0.5 + 7.5*z)*(2 + std::log(z));
204}
205
206} // namespace two_loop
207} // namespace amm_loop_functions
208} // namespace flexiblesusy
Out of bounds access.
Definition: error.hpp:208
double BarrZeeLoopV(double z)
Barr-Zee 2-loop function with vector.
double BarrZeeLoopFSZ(double x, double y)
Barr-Zee 2-loop function with fermion loop.
double BarrZeeLoopFPZ(double x, double y)
Barr-Zee 2-loop function with fermion loop.
double BarrZeeLoopS(double z)
Barr-Zee 2-loop function with scalar loop.
double BarrZeeLoopFP(double z)
Barr-Zee 2-loop function with fermion loop.
double BarrZeeLoopFS(double z)
Barr-Zee 2-loop function with fermion loop.
const Real epsilon
Definition: mathdefs.hpp:18
double Li2(double x) noexcept
Real dilogarithm .
Definition: Li2.cpp:68
double Cl2(double x) noexcept
Clausen function .
Definition: Cl2.cpp:31
Complex< T > log(const Complex< T > &z) noexcept
Definition: complex.hpp:54
void sort(Eigen::Array< double, N, 1 > &v)
sorts an Eigen array
void swap(nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass > &j1, nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass > &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) is_nothrow_move_constructible< nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass > >::value &&//NOLINT(misc-redundant-expression, cppcoreguidelines-noexcept-swap, performance-noexcept-swap) is_nothrow_move_assignable< nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass > >::value)
exchanges the values of two JSON objects
Definition: json.hpp:24537