3 #define fac 0.0174532925199
5 void chand(
float xphi,
float xmuv,
float xmus,
float *xtau,
float *rhoray,
double *trup,
double *trdown,
int nbands,
char *process) {
17 const double xfd = 0.958725775;
18 const float xbeta2 = 0.5;
20 double fs01, fs02, fs0, fs1, fs2;
21 const float as0[10] = {0.33243832, 0.16285370, -0.30924818, -0.10324388, 0.11493334,
22 -6.777104e-02, 1.577425e-03, -1.240906e-02, 3.241678e-02, -3.503695e-02};
23 const float as1[2] = {.19666292, -5.439061e-02};
24 const float as2[2] = {.14545937, -2.910845e-02};
25 float phios, xcosf1, xcosf2, xcosf3;
26 float xph1, xph2, xph3, xitm1, xitm2;
27 float xlntau, xitot1, xitot2, xitot3;
32 xcosf2 = cosf(phios *
fac);
33 xcosf3 = cosf(2 * phios *
fac);
34 xph1 = 1 + (3 * xmus * xmus - 1) * (3 * xmuv * xmuv - 1) * xfd / 8.;
35 xph2 = -xfd * xbeta2 * 1.5 * xmus * xmuv * sqrtf(1 - xmus * xmus) * sqrtf(1 - xmuv * xmuv);
36 xph3 = xfd * xbeta2 * 0.375 * (1 - xmus * xmus) * (1 - xmuv * xmuv);
40 pl[3] = xmus * xmus + xmuv * xmuv;
41 pl[4] = xmus * xmus * xmuv * xmuv;
43 for (
i = 0;
i < 5;
i++) fs01 += pl[
i] * as0[
i];
44 for (
i = 0;
i < 5;
i++) fs02 += pl[
i] * as0[5 +
i];
45 for (ib = 0; ib <
nbands; ib++) {
47 xlntau = logf(xtau[ib]);
48 fs0 = fs01 + fs02 * xlntau;
49 fs1 = as1[0] + xlntau * as1[1];
50 fs2 = as2[0] + xlntau * as2[1];
51 trdown[ib] = expf(-xtau[ib] / xmus);
52 trup[ib] = expf(-xtau[ib] / xmuv);
53 xitm1 = (1 - trdown[ib] * trup[ib]) / 4. / (xmus + xmuv);
54 xitm2 = (1 - trdown[ib]) * (1 - trup[ib]);
55 xitot1 = xph1 * (xitm1 + xitm2 * fs0);
56 xitot2 = xph2 * (xitm1 + xitm2 * fs1);
57 xitot3 = xph3 * (xitm1 + xitm2 * fs2);
58 rhoray[ib] = xitot1 * xcosf1 + xitot2 * xcosf2 * 2 + xitot3 * xcosf3 * 2;