#include <TLi2.h>
Public Member Functions | |
TLi2 () | |
~TLi2 () | |
Static Public Member Functions | |
static double | Eval (const double &x) |
static double | Li2Cern (const double &x) |
static double | Li2My (const double &x) |
Definition at line 4 of file TLi2.h.
static double TLi2::Eval | ( | const double & | x | ) | [inline, static] |
Definition at line 8 of file TLi2.h.
References Li2My().
Referenced by TPiKFun::Eval_even(), TMuKFun::Eval_even(), TPiKFun::Eval_even_odd(), TMuKFun::Eval_even_odd(), TPiKFun::Eval_odd(), TMuKFun::Eval_odd(), TPiKFun::Eval_odd_ultra(), TMuKFun::Eval_odd_ultra(), TKFun::kfun(), and TEKFun::kfun().
double TLi2::Li2Cern | ( | const double & | x | ) | [static] |
Definition at line 46 of file TLi2.C.
References genRecEmupikp::i, M_PI, one, s, t(), and zero.
00046 { 00047 static long double pi3 = M_PI*M_PI/3; 00048 static long double pi6 = M_PI*M_PI/6; 00049 static long double pi12 = M_PI*M_PI/12; 00050 static long double c[20]={0.42996693560813697L, 0.40975987533077105L, 00051 -0.01858843665014592L, 0.00145751084062268L, 00052 -0.00014304184442340L, 0.00001588415541880L, 00053 -0.00000190784959387L, 0.00000024195180854L, 00054 -0.00000003193341274L, 0.00000000434545063L, 00055 -0.00000000060578480L, 0.00000000008612098L, 00056 -0.00000000001244332L, 0.00000000000182256L, 00057 -0.00000000000027007L, 0.00000000000004042L, 00058 -0.00000000000000610L, 0.00000000000000093L, 00059 -0.00000000000000014L, 0.00000000000000002L}; 00060 long double h,t,y,s,l,ll,a,alfa,b0,b1,b2,*cp; 00061 static long double two = 2L, one=1L, half=0.5L, zero = 0L; 00062 if(x == one){ 00063 h = pi6; 00064 }else if(x == -one){ 00065 h = -pi12; 00066 }else{ 00067 t = -x; 00068 if(t <= -two){ 00069 y =-one/(one + t); 00070 s = one; 00071 l = log(-t); 00072 ll = log(one + one/t); 00073 a =-pi3 + half*(l*l - ll*ll); 00074 }else if(t < -one){ 00075 y =-one-t; 00076 s =-one; 00077 a = log(-t); 00078 a =-pi6 + a*(a + log(one + one/t)); 00079 }else if(t <= -half){ 00080 y =-(one+t)/t; 00081 s = one; 00082 a = log(-t); 00083 a =-pi6 + a*(-half*a+log(one + t)); 00084 }else if(t < zero){ 00085 y =-t/(one + t); 00086 s =-one; 00087 a = half*log(one + t)*log(one + t); 00088 }else if(t <= one){ 00089 y = t; 00090 s = one; 00091 a = zero; 00092 }else{ 00093 y = one/t; 00094 s =-one; 00095 a = pi6 + half*log(t)*log(t); 00096 } 00097 h = y + y - one; 00098 alfa = h + h; 00099 b1 = zero; 00100 b2 = zero; 00101 cp = &c[19]; 00102 for(int i = 20; i; i--,cp--){ 00103 b0 = *cp + alfa*b1 - b2; 00104 b2 = b1; 00105 b1 = b0; 00106 } 00107 h = -(s*(b0-h*b2)+a); 00108 } 00109 // std::cout<<"TLI2 "<<x<<" "<<h<<std::endl; 00110 return h; 00111 }
double TLi2::Li2My | ( | const double & | x | ) | [static] |
Definition at line 113 of file TLi2.C.
References H00, H01, H02, H03, H04, H05, H06, H07, H08, H09, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, M_PI, one, s, t(), and zero.
Referenced by Eval().
00113 { 00114 const double pi3 = M_PI*M_PI/3; 00115 const double pi6 = M_PI*M_PI/6; 00116 const double mpi12 = -M_PI*M_PI/12; 00117 const double two = 2, one=1, half=0.5, zero = 0; 00118 static double t,h,y,s,a,l,ll; 00119 if ( x == one) return pi6; 00120 if ( x == -one) return mpi12; 00121 t = -x; 00122 if(t <= -two){ 00123 // 2 < x < +inf 00124 y =-one/(one + t); 00125 s = one; 00126 l = log(-t); 00127 ll= log(one + one/t); 00128 a =-pi3 + half*(l*l - ll*ll); 00129 }else if(t < -one){ 00130 // 1 < x < 2 00131 y =-one-t; 00132 s =-one; 00133 a = log(-t); 00134 a =-pi6 + a*(a + log(one + one/t)); 00135 }else if(t <= -half){ 00136 // 0.5 < x < 1 00137 y =-(one+t)/t; 00138 s = one; 00139 a = log(-t); 00140 a =-pi6 + a*(-half*a+log(one + t)); 00141 }else if(t < zero){ 00142 // 0 < x < 0.5 00143 h = 4*x - one; 00144 // minimax approximation 00145 return 00146 H00+(H01+(H02+(H03+(H04+(H05+(H06+(H07+(H08+(H09+(H10+(H11+(H12+(H13+(H14+(H15+(H16+(H17+(H18+H19*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h; 00147 }else if(t <= one){ 00148 // -1 < x < 0 00149 y = t; 00150 s = one; 00151 a = zero; 00152 }else{ 00153 // -inf < x < -1 00154 y = one/t; 00155 s =-one; 00156 a = log(t); 00157 a = pi6 + half*a*a; 00158 } 00159 h = -two*y + one; 00160 // minimax approximation in -1 < x < 0 range 00161 return 00162 (K00+(K01+(K02+(K03+(K04+(K05+(K06+(K07+(K08+(K09+(K10+(K11+(K12+(K13+(K14+(K15+(K16+(K17+(K18+K19*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*h)*s-a; 00163 }