53 data->
A_s,data->
n_s, &status);
61 if(!strcmp(compare_type,
"histo")) {
69 double *zarr_1,*pzarr_1,*zarr_2,*pzarr_2,*bzarr,*az1arr,*rz1arr,*az2arr,*rz2arr;
70 if(!strcmp(compare_type,
"analytic")) {
74 FILE *ampz1=fopen(
"./tests/benchmark/codecomp_step2_outputs/cclamparranalytic1nz512nb.txt",
"r");
76 FILE *ampz2=fopen(
"./tests/benchmark/codecomp_step2_outputs/cclamparranalytic2nz512nb.txt",
"r");
79 double zmean_1=1.0,sigz_1=0.15;
80 double zmean_2=1.5,sigz_2=0.15;
82 zarr_1=malloc(nz*
sizeof(
double));
83 pzarr_1=malloc(nz*
sizeof(
double));
84 zarr_2=malloc(nz*
sizeof(
double));
85 pzarr_2=malloc(nz*
sizeof(
double));
86 bzarr=malloc(nz*
sizeof(
double));
87 az1arr=malloc(nz*
sizeof(
double));
88 rz1arr=malloc(nz*
sizeof(
double));
89 az2arr=malloc(nz*
sizeof(
double));
90 rz2arr=malloc(nz*
sizeof(
double));
91 for(
int ii=0;ii<
nz;ii++) {
92 double zia1,zia2,aia1,aia2;
93 stat = fscanf(ampz1,
"%lf %lf",&zia1,&aia1);
94 stat = fscanf(ampz2,
"%lf %lf",&zia2,&aia2);
99 double z1=zmean_1-5*sigz_1+10*sigz_1*(ii+0.5)/
nz;
100 double z2=zmean_2-5*sigz_2+10*sigz_2*(ii+0.5)/
nz;
101 double pz1=exp(-0.5*((
z1-zmean_1)*(
z1-zmean_1)/(sigz_1*sigz_1)));
102 double pz2=exp(-0.5*((
z2-zmean_2)*(
z2-zmean_2)/(sigz_2*sigz_2)));
114 FILE *fnz1=fopen(
"./tests/benchmark/codecomp_step2_outputs/bin1_histo.txt",
"r");
116 FILE *fnz2=fopen(
"./tests/benchmark/codecomp_step2_outputs/bin2_histo.txt",
"r");
118 FILE *ampz1=fopen(
"./tests/benchmark/codecomp_step2_outputs/cclamparrhisto1nznb.txt",
"r");
120 FILE *ampz2=fopen(
"./tests/benchmark/codecomp_step2_outputs/cclamparrhisto2nznb.txt",
"r");
123 zarr_1=malloc(nz*
sizeof(
double));
124 pzarr_1=malloc(nz*
sizeof(
double));
125 zarr_2=malloc(nz*
sizeof(
double));
126 pzarr_2=malloc(nz*
sizeof(
double));
127 bzarr=malloc(nz*
sizeof(
double));
128 az1arr=malloc(nz*
sizeof(
double));
129 rz1arr=malloc(nz*
sizeof(
double));
130 az2arr=malloc(nz*
sizeof(
double));
131 rz2arr=malloc(nz*
sizeof(
double));
132 rtn = fgets(str,1024,fnz1);
133 rtn = fgets(str,1024,fnz2);
134 for(
int ii=0;ii<
nz;ii++) {
135 double z1,
z2,nz1,nz2,zia1,zia2,aia1,aia2;
136 stat = fscanf(fnz1,
"%lf %lf",&z1,&nz1);
137 stat = fscanf(fnz2,
"%lf %lf",&z2,&nz2);
138 stat = fscanf(ampz1,
"%lf %lf",&zia1,&aia1);
139 stat = fscanf(ampz2,
"%lf %lf",&zia2,&aia2);
140 zarr_1[ii]=
z1; zarr_2[ii]=
z2;
141 pzarr_1[ii]=nz1; pzarr_2[ii]=nz2;
151 FILE *fi_dd_11,*fi_dd_12,*fi_dd_22;
152 FILE *fi_dl_12,*fi_dl_11,*fi_dl_22,*fi_dl_21;
153 FILE *fi_di_12,*fi_di_11,*fi_di_22,*fi_di_21;
154 FILE *fi_dc_1,*fi_dc_2;
155 FILE *fi_ll_11,*fi_ll_12,*fi_ll_22;
156 FILE *fi_ii_11,*fi_ii_12,*fi_ii_22;
157 FILE *fi_li_11,*fi_li_12,*fi_li_22;
158 FILE *fi_lc_1,*fi_lc_2;
168 CCL_ClTracer *tr_wli_1=
ccl_cl_tracer_lensing(cosmo,1,nz,zarr_1,pzarr_1,nz,zarr_1,az1arr,nz,zarr_1,rz1arr,&status);
170 CCL_ClTracer *tr_wli_2=
ccl_cl_tracer_lensing(cosmo,1,nz,zarr_2,pzarr_2,nz,zarr_2,az2arr,nz,zarr_2,rz2arr,&status);
175 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_cl_dd.txt",compare_type);
177 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_cl_dd.txt",compare_type);
179 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_cl_dd.txt",compare_type);
181 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_cl_dc.txt",compare_type);
183 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_cl_dc.txt",compare_type);
185 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_cl_ll.txt",compare_type);
187 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_cl_ll.txt",compare_type);
189 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_cl_ll.txt",compare_type);
191 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_cl_ii.txt",compare_type);
193 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_cl_ii.txt",compare_type);
195 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_cl_ii.txt",compare_type);
197 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_cl_li.txt",compare_type);
199 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_cl_li.txt",compare_type);
201 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_cl_li.txt",compare_type);
203 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_cl_dl.txt",compare_type);
205 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_cl_dl.txt",compare_type);
207 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b1%s_log_cl_dl.txt",compare_type);
209 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_cl_dl.txt",compare_type);
211 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_cl_di.txt",compare_type);
213 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b2%s_log_cl_di.txt",compare_type);
215 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b1%s_log_cl_di.txt",compare_type);
217 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_cl_di.txt",compare_type);
219 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b1b1%s_log_cl_lc.txt",compare_type);
221 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_b2b2%s_log_cl_lc.txt",compare_type);
223 sprintf(fname,
"tests/benchmark/codecomp_step2_outputs/run_log_cl_cc.txt");
226 int *ells=malloc(
NELLS*
sizeof(
int));
227 double *cls_dd_11_b=malloc(
NELLS*
sizeof(
double));
228 double *cls_dd_12_b=malloc(
NELLS*
sizeof(
double));
229 double *cls_dd_22_b=malloc(
NELLS*
sizeof(
double));
230 double *cls_dl_11_b=malloc(
NELLS*
sizeof(
double));
231 double *cls_dl_12_b=malloc(
NELLS*
sizeof(
double));
232 double *cls_dl_21_b=malloc(
NELLS*
sizeof(
double));
233 double *cls_dl_22_b=malloc(
NELLS*
sizeof(
double));
234 double *cls_di_11_b=malloc(
NELLS*
sizeof(
double));
235 double *cls_di_12_b=malloc(
NELLS*
sizeof(
double));
236 double *cls_di_21_b=malloc(
NELLS*
sizeof(
double));
237 double *cls_di_22_b=malloc(
NELLS*
sizeof(
double));
238 double *cls_dc_1_b=malloc(
NELLS*
sizeof(
double));
239 double *cls_dc_2_b=malloc(
NELLS*
sizeof(
double));
240 double *cls_ll_11_b=malloc(
NELLS*
sizeof(
double));
241 double *cls_ll_12_b=malloc(
NELLS*
sizeof(
double));
242 double *cls_ll_22_b=malloc(
NELLS*
sizeof(
double));
243 double *cls_li_11_b=malloc(
NELLS*
sizeof(
double));
244 double *cls_li_12_b=malloc(
NELLS*
sizeof(
double));
245 double *cls_li_22_b=malloc(
NELLS*
sizeof(
double));
246 double *cls_ii_11_b=malloc(
NELLS*
sizeof(
double));
247 double *cls_ii_12_b=malloc(
NELLS*
sizeof(
double));
248 double *cls_ii_22_b=malloc(
NELLS*
sizeof(
double));
249 double *cls_lc_1_b=malloc(
NELLS*
sizeof(
double));
250 double *cls_lc_2_b=malloc(
NELLS*
sizeof(
double));
251 double *cls_cc_b=malloc(
NELLS*
sizeof(
double));
252 double *cls_dd_11_h=malloc(
NELLS*
sizeof(
double));
253 double *cls_dd_12_h=malloc(
NELLS*
sizeof(
double));
254 double *cls_dd_22_h=malloc(
NELLS*
sizeof(
double));
255 double *cls_dl_11_h=malloc(
NELLS*
sizeof(
double));
256 double *cls_dl_12_h=malloc(
NELLS*
sizeof(
double));
257 double *cls_dl_21_h=malloc(
NELLS*
sizeof(
double));
258 double *cls_dl_22_h=malloc(
NELLS*
sizeof(
double));
259 double *cls_dltot_11_h=malloc(
NELLS*
sizeof(
double));
260 double *cls_dltot_12_h=malloc(
NELLS*
sizeof(
double));
261 double *cls_dltot_21_h=malloc(
NELLS*
sizeof(
double));
262 double *cls_dltot_22_h=malloc(
NELLS*
sizeof(
double));
263 double *cls_dc_1_h=malloc(
NELLS*
sizeof(
double));
264 double *cls_dc_2_h=malloc(
NELLS*
sizeof(
double));
265 double *cls_ll_11_h=malloc(
NELLS*
sizeof(
double));
266 double *cls_ll_12_h=malloc(
NELLS*
sizeof(
double));
267 double *cls_ll_22_h=malloc(
NELLS*
sizeof(
double));
268 double *cls_lltot_11_h=malloc(
NELLS*
sizeof(
double));
269 double *cls_lltot_12_h=malloc(
NELLS*
sizeof(
double));
270 double *cls_lltot_22_h=malloc(
NELLS*
sizeof(
double));
271 double *cls_lli_11_h=malloc(
NELLS*
sizeof(
double));
272 double *cls_lli_12_h=malloc(
NELLS*
sizeof(
double));
273 double *cls_lli_21_h=malloc(
NELLS*
sizeof(
double));
274 double *cls_lli_22_h=malloc(
NELLS*
sizeof(
double));
275 double *cls_lc_1_h=malloc(
NELLS*
sizeof(
double));
276 double *cls_lc_2_h=malloc(
NELLS*
sizeof(
double));
277 double *cls_cc_h=malloc(
NELLS*
sizeof(
double));
279 for(
int ii=0;ii<
NELLS;ii++) {
281 stat=fscanf(fi_dd_11,
"%d %lf",&l,&(cls_dd_11_b[ii]));
283 fprintf(stderr,
"Error reading benchmark file");
286 stat=fscanf(fi_dd_12,
"%d %lf",&l,&(cls_dd_12_b[ii]));
288 fprintf(stderr,
"Error reading benchmark file");
291 stat=fscanf(fi_dd_22,
"%d %lf",&l,&(cls_dd_22_b[ii]));
293 fprintf(stderr,
"Error reading benchmark file");
296 stat=fscanf(fi_dl_11,
"%d %lf",&l,&(cls_dl_11_b[ii]));
298 fprintf(stderr,
"Error reading benchmark file");
301 stat=fscanf(fi_dl_12,
"%d %lf",&l,&(cls_dl_12_b[ii]));
303 fprintf(stderr,
"Error reading benchmark file");
306 stat=fscanf(fi_dl_22,
"%d %lf",&l,&(cls_dl_22_b[ii]));
308 fprintf(stderr,
"Error reading benchmark file");
311 stat=fscanf(fi_dl_21,
"%d %lf",&l,&(cls_dl_21_b[ii]));
313 fprintf(stderr,
"Error reading benchmark file");
316 stat=fscanf(fi_di_11,
"%d %lf",&l,&(cls_di_11_b[ii]));
318 fprintf(stderr,
"Error reading benchmark file");
321 stat=fscanf(fi_di_12,
"%d %lf",&l,&(cls_di_12_b[ii]));
323 fprintf(stderr,
"Error reading benchmark file");
326 stat=fscanf(fi_di_22,
"%d %lf",&l,&(cls_di_22_b[ii]));
328 fprintf(stderr,
"Error reading benchmark file");
331 stat=fscanf(fi_di_21,
"%d %lf",&l,&(cls_di_21_b[ii]));
333 fprintf(stderr,
"Error reading benchmark file");
336 stat=fscanf(fi_dc_1,
"%d %lf",&l,&(cls_dc_1_b[ii]));
338 fprintf(stderr,
"Error reading benchmark file");
341 stat=fscanf(fi_dc_2,
"%d %lf",&l,&(cls_dc_2_b[ii]));
343 fprintf(stderr,
"Error reading benchmark file");
346 stat=fscanf(fi_ll_11,
"%d %lf",&l,&(cls_ll_11_b[ii]));
348 fprintf(stderr,
"Error reading benchmark file");
351 stat=fscanf(fi_ll_12,
"%d %lf",&l,&(cls_ll_12_b[ii]));
353 fprintf(stderr,
"Error reading benchmark file");
356 stat=fscanf(fi_ll_22,
"%d %lf",&l,&(cls_ll_22_b[ii]));
358 fprintf(stderr,
"Error reading benchmark file");
361 stat=fscanf(fi_li_11,
"%d %lf",&l,&(cls_li_11_b[ii]));
363 fprintf(stderr,
"Error reading benchmark file");
366 stat=fscanf(fi_li_12,
"%d %lf",&l,&(cls_li_12_b[ii]));
368 fprintf(stderr,
"Error reading benchmark file");
371 stat=fscanf(fi_li_22,
"%d %lf",&l,&(cls_li_22_b[ii]));
373 fprintf(stderr,
"Error reading benchmark file");
376 stat=fscanf(fi_ii_11,
"%d %lf",&l,&(cls_ii_11_b[ii]));
378 fprintf(stderr,
"Error reading benchmark file");
381 stat=fscanf(fi_ii_12,
"%d %lf",&l,&(cls_ii_12_b[ii]));
383 fprintf(stderr,
"Error reading benchmark file");
386 stat=fscanf(fi_ii_22,
"%d %lf",&l,&(cls_ii_22_b[ii]));
388 fprintf(stderr,
"Error reading benchmark file");
391 stat=fscanf(fi_lc_1,
"%d %lf",&l,&(cls_lc_1_b[ii]));
393 fprintf(stderr,
"Error reading benchmark file");
396 stat=fscanf(fi_lc_2,
"%d %lf",&l,&(cls_lc_2_b[ii]));
398 fprintf(stderr,
"Error reading benchmark file");
401 stat=fscanf(fi_cc,
"%d %lf",&l,&(cls_cc_b[ii]));
403 fprintf(stderr,
"Error reading benchmark file");
435 double l_logstep = 1.05;
436 double l_linstep = 5.;
439 ccl_angular_cls(cosmo,w,tr_nc_1,tr_nc_1,NELLS,ells,cls_dd_11_h,&status);
441 ccl_angular_cls(cosmo,w,tr_nc_1,tr_nc_2,NELLS,ells,cls_dd_12_h,&status);
443 ccl_angular_cls(cosmo,w,tr_nc_2,tr_nc_2,NELLS,ells,cls_dd_22_h,&status);
445 ccl_angular_cls(cosmo,w,tr_nc_1,tr_wl_1,NELLS,ells,cls_dl_11_h,&status);
447 ccl_angular_cls(cosmo,w,tr_nc_1,tr_wl_2,NELLS,ells,cls_dl_12_h,&status);
449 ccl_angular_cls(cosmo,w,tr_nc_2,tr_wl_2,NELLS,ells,cls_dl_22_h,&status);
451 ccl_angular_cls(cosmo,w,tr_nc_2,tr_wl_1,NELLS,ells,cls_dl_21_h,&status);
453 ccl_angular_cls(cosmo,w,tr_nc_1,tr_wli_1,NELLS,ells,cls_dltot_11_h,&status);
455 ccl_angular_cls(cosmo,w,tr_nc_1,tr_wli_2,NELLS,ells,cls_dltot_12_h,&status);
457 ccl_angular_cls(cosmo,w,tr_nc_2,tr_wli_1,NELLS,ells,cls_dltot_21_h,&status);
459 ccl_angular_cls(cosmo,w,tr_nc_2,tr_wli_2,NELLS,ells,cls_dltot_22_h,&status);
461 ccl_angular_cls(cosmo,w,tr_wli_1,tr_wli_1,NELLS,ells,cls_lltot_11_h,&status);
463 ccl_angular_cls(cosmo,w,tr_wli_1,tr_wli_2,NELLS,ells,cls_lltot_12_h,&status);
465 ccl_angular_cls(cosmo,w,tr_wli_2,tr_wli_2,NELLS,ells,cls_lltot_22_h,&status);
467 ccl_angular_cls(cosmo,w,tr_wl_1,tr_wli_1,NELLS,ells,cls_lli_11_h,&status);
469 ccl_angular_cls(cosmo,w,tr_wl_1,tr_wli_2,NELLS,ells,cls_lli_12_h,&status);
471 ccl_angular_cls(cosmo,w,tr_wl_2,tr_wli_1,NELLS,ells,cls_lli_21_h,&status);
473 ccl_angular_cls(cosmo,w,tr_wl_2,tr_wli_2,NELLS,ells,cls_lli_22_h,&status);
479 ccl_angular_cls(cosmo,w,tr_wl_1,tr_wl_1,NELLS,ells,cls_ll_11_h,&status);
481 ccl_angular_cls(cosmo,w,tr_wl_1,tr_wl_2,NELLS,ells,cls_ll_12_h,&status);
483 ccl_angular_cls(cosmo,w,tr_wl_2,tr_wl_2,NELLS,ells,cls_ll_22_h,&status);
492 double fraction_failed=0;
493 for(
int ii=2;ii<w->
n_ls-1;ii++) {
495 double ell_correct,ell_correct2;
496 double el_dd_11,el_dd_12,el_dd_22;
497 double el_dl_11,el_dl_12,el_dl_21,el_dl_22;
498 double el_dltot_11,el_dltot_12,el_dltot_21,el_dltot_22;
499 double el_dc_1,el_dc_2;
500 double el_ll_11,el_ll_12,el_ll_22;
501 double el_li_11,el_li_12,el_li_22;
502 double el_ii_11,el_ii_12,el_ii_22;
503 double el_lltot_11,el_lltot_12,el_lltot_22;
504 double el_lc_1,el_lc_2;
506 double cl_dd_11,cl_dd_12,cl_dd_22;
507 double cl_dl_12,cl_dl_11,cl_dl_21,cl_dl_22;
508 double cl_di_12,cl_di_11,cl_di_21,cl_di_22;
509 double cl_dltot_12,cl_dltot_11,cl_dltot_21,cl_dltot_22;
510 double cl_lltot_11,cl_lltot_12,cl_lltot_22;
511 double cl_dc_1,cl_dc_2;
512 double cl_ll_11,cl_ll_12,cl_ll_22;
513 double cl_li_11,cl_li_12,cl_li_22;
514 double cl_ii_11,cl_ii_12,cl_ii_22;
515 double cl_lc_1,cl_lc_2;
517 double cl_dd_11_h,cl_dd_12_h,cl_dd_22_h;
518 double cl_dl_12_h,cl_dl_11_h,cl_dl_21_h,cl_dl_22_h;
519 double cl_di_12_h,cl_di_11_h,cl_di_21_h,cl_di_22_h;
520 double cl_dltot_12_h,cl_dltot_11_h,cl_dltot_21_h,cl_dltot_22_h;
521 double cl_dc_1_h,cl_dc_2_h;
522 double cl_ll_11_h,cl_ll_12_h,cl_ll_22_h;
523 double cl_li_11_h,cl_li_12_h,cl_li_22_h;
524 double cl_ii_11_h,cl_ii_12_h,cl_ii_22_h;
525 double cl_lltot_11_h,cl_lltot_12_h,cl_lltot_22_h;
526 double cl_lc_1_h,cl_lc_2_h;
531 ell_correct=l*(l+1.)/
sqrt((l+2.)*(l+1.)*l*(l-1.));
532 ell_correct2=(l+0.5)*(l+0.5)/
sqrt((l+2.)*(l+1.)*l*(l-1.));
534 cl_dd_11 =cls_dd_11_b[
l];
535 cl_dd_12 =cls_dd_12_b[
l];
536 cl_dd_22 =cls_dd_22_b[
l];
537 cl_dl_12 =cls_dl_12_b[
l];
538 cl_dl_11 =cls_dl_11_b[
l];
539 cl_dl_21 =cls_dl_21_b[
l];
540 cl_dl_22 =cls_dl_22_b[
l];
541 cl_di_12 =cls_di_12_b[
l];
542 cl_di_11 =cls_di_11_b[
l];
543 cl_di_21 =cls_di_21_b[
l];
544 cl_di_22 =cls_di_22_b[
l];
545 cl_dltot_11=cl_dl_11+cl_di_11;
546 cl_dltot_12=cl_dl_12+cl_di_12;
547 cl_dltot_21=cl_dl_21+cl_di_21;
548 cl_dltot_22=cl_dl_22+cl_di_22;
549 cl_dc_1 =cls_dc_1_b[
l];
550 cl_dc_2 =cls_dc_2_b[
l];
551 cl_ll_11 =cls_ll_11_b[
l];
552 cl_ll_12 =cls_ll_12_b[
l];
553 cl_ll_22 =cls_ll_22_b[
l];
554 cl_li_11 =cls_li_11_b[
l];
555 cl_li_12 =cls_li_12_b[
l];
556 cl_li_22 =cls_li_22_b[
l];
557 cl_ii_11 =cls_ii_11_b[
l];
558 cl_ii_12 =cls_ii_12_b[
l];
559 cl_ii_22 =cls_ii_22_b[
l];
560 cl_lltot_11=cl_ll_11+cl_li_11+cl_ii_11;
561 cl_lltot_12=cl_ll_12+cl_li_12+cl_ii_12;
562 cl_lltot_22=cl_ll_22+cl_li_22+cl_ii_22;
563 cl_lc_1 =cls_lc_1_b[
l];
564 cl_lc_2 =cls_lc_2_b[
l];
573 el_dltot_11=
ELS_TOLERANCE*
sqrt((cl_dd_11*cl_lltot_11+cl_dltot_11*cl_dltot_11)/(2*l+1.));
574 el_dltot_12=
ELS_TOLERANCE*
sqrt((cl_dd_11*cl_lltot_22+cl_dltot_12*cl_dltot_12)/(2*l+1.));
575 el_dltot_21=
ELS_TOLERANCE*
sqrt((cl_dd_22*cl_lltot_11+cl_dltot_21*cl_dltot_21)/(2*l+1.));
576 el_dltot_22=
ELS_TOLERANCE*
sqrt((cl_dd_22*cl_lltot_22+cl_dltot_22*cl_dltot_22)/(2*l+1.));
588 el_lltot_11=
ELS_TOLERANCE*
sqrt((cl_lltot_11*cl_lltot_11+cl_lltot_11*cl_lltot_11)/(2*l+1.));
589 el_lltot_12=
ELS_TOLERANCE*
sqrt((cl_lltot_11*cl_lltot_22+cl_lltot_12*cl_lltot_12)/(2*l+1.));
590 el_lltot_22=
ELS_TOLERANCE*
sqrt((cl_lltot_22*cl_lltot_22+cl_lltot_22*cl_lltot_22)/(2*l+1.));
594 cl_dd_11_h=cls_dd_11_h[
l];
595 cl_dd_12_h=cls_dd_12_h[
l];
596 cl_dd_22_h=cls_dd_22_h[
l];
597 cl_dl_11_h=cls_dl_11_h[
l]*ell_correct2;
598 cl_dl_12_h=cls_dl_12_h[
l]*ell_correct2;
599 cl_dl_21_h=cls_dl_21_h[
l]*ell_correct2;
600 cl_dl_22_h=cls_dl_22_h[
l]*ell_correct2;
601 cl_dltot_11_h=cls_dltot_11_h[
l]*ell_correct2;
602 cl_dltot_12_h=cls_dltot_12_h[
l]*ell_correct2;
603 cl_dltot_21_h=cls_dltot_21_h[
l]*ell_correct2;
604 cl_dltot_22_h=cls_dltot_22_h[
l]*ell_correct2;
605 cl_di_11_h=cl_dltot_11_h-cl_dl_11_h;
606 cl_di_12_h=cl_dltot_12_h-cl_dl_12_h;
607 cl_di_21_h=cl_dltot_21_h-cl_dl_21_h;
608 cl_di_22_h=cl_dltot_22_h-cl_dl_22_h;
609 cl_dc_1_h=cls_dc_1_h[
l];
610 cl_dc_2_h=cls_dc_2_h[
l];
611 cl_ll_11_h=cls_ll_11_h[
l]*ell_correct2*ell_correct2;
612 cl_ll_12_h=cls_ll_12_h[
l]*ell_correct2*ell_correct2;
613 cl_ll_22_h=cls_ll_22_h[
l]*ell_correct2*ell_correct2;
614 cl_li_11_h=2*(cls_lli_11_h[
l]-cls_ll_11_h[
l])*ell_correct2*ell_correct2;
615 cl_li_12_h=(cls_lli_12_h[
l]+cls_lli_21_h[
l]-2*cls_ll_12_h[
l])*ell_correct2*ell_correct2;
616 cl_li_22_h=2*(cls_lli_22_h[
l]-cls_ll_22_h[
l])*ell_correct2*ell_correct2;
617 cl_ii_11_h=(cls_lltot_11_h[
l]+cls_ll_11_h[
l]-2*cls_lli_11_h[
l])*ell_correct2*ell_correct2;
618 cl_ii_12_h=(cls_lltot_12_h[
l]+cls_ll_12_h[
l]-cls_lli_12_h[
l]-cls_lli_21_h[
l])*ell_correct2*ell_correct2;
619 cl_ii_22_h=(cls_lltot_22_h[
l]+cls_ll_22_h[
l]-2*cls_lli_22_h[
l])*ell_correct2*ell_correct2;
620 cl_lltot_11_h=cls_lltot_11_h[
l]*ell_correct2*ell_correct2;
621 cl_lltot_12_h=cls_lltot_12_h[
l]*ell_correct2*ell_correct2;
622 cl_lltot_22_h=cls_lltot_22_h[
l]*ell_correct2*ell_correct2;
623 cl_lc_1_h=cls_lc_1_h[
l]*ell_correct;
624 cl_lc_2_h=cls_lc_2_h[
l]*ell_correct;
638 ASSERT_TRUE(fabs(cl_di_11_h-cl_di_11)<el_dltot_11);
639 ASSERT_TRUE(fabs(cl_di_12_h-cl_di_12)<el_dltot_12);
640 ASSERT_TRUE(fabs(cl_di_21_h-cl_di_21)<el_dltot_21);
641 ASSERT_TRUE(fabs(cl_di_22_h-cl_di_22)<el_dltot_22);
647 ASSERT_TRUE(fabs(cl_li_11_h-cl_li_11)<el_lltot_11);
648 ASSERT_TRUE(fabs(cl_li_12_h-cl_li_12)<el_lltot_12);
649 ASSERT_TRUE(fabs(cl_li_22_h-cl_li_22)<el_lltot_22);
650 ASSERT_TRUE(fabs(cl_ii_11_h-cl_ii_11)<el_lltot_11);
651 ASSERT_TRUE(fabs(cl_ii_12_h-cl_ii_12)<el_lltot_12);
652 ASSERT_TRUE(fabs(cl_ii_22_h-cl_ii_22)<el_lltot_22);
659 if(!strcmp(compare_type,
"histo")) {
666 free(cls_dd_11_b); free(cls_dd_12_b); free(cls_dd_22_b);
667 free(cls_dl_12_b);free(cls_dl_21_b);free(cls_dl_11_b);free(cls_dl_22_b);
668 free(cls_di_12_b);free(cls_di_21_b);free(cls_di_11_b);free(cls_di_22_b);
669 free(cls_dc_1_b); free(cls_dc_2_b);
670 free(cls_ll_11_b); free(cls_ll_12_b); free(cls_ll_22_b);
671 free(cls_li_11_b); free(cls_li_12_b); free(cls_li_22_b);
672 free(cls_ii_11_b); free(cls_ii_12_b); free(cls_ii_22_b);
673 free(cls_lc_1_b); free(cls_lc_2_b);
676 free(cls_dd_11_h); free(cls_dd_12_h); free(cls_dd_22_h);
677 free(cls_dl_12_h);free(cls_dl_11_h);free(cls_dl_21_h);free(cls_dl_22_h);
678 free(cls_dltot_12_h);free(cls_dltot_11_h);free(cls_dltot_21_h);free(cls_dltot_22_h);
679 free(cls_dc_1_h); free(cls_dc_2_h);
680 free(cls_ll_11_h); free(cls_ll_12_h); free(cls_ll_22_h);
681 free(cls_lltot_11_h); free(cls_lltot_12_h); free(cls_lltot_22_h);
682 free(cls_lli_11_h); free(cls_lli_12_h); free(cls_lli_21_h); free(cls_lli_22_h);
683 free(cls_lc_1_h); free(cls_lc_2_h);
void ccl_set_debug_policy(CCLDebugModePolicy debug_policy)
CCL_ClTracer * ccl_cl_tracer_lensing(ccl_cosmology *cosmo, int has_alignment, int nz_n, double *z_n, double *n, int nz_ba, double *z_ba, double *ba, int nz_rf, double *z_rf, double *rf, int *status)
matter_power_spectrum_t matter_power_spectrum_method
#define ASSERT_TRUE(real)
void ccl_cl_tracer_free(CCL_ClTracer *clt)
transfer_function_t transfer_function_method
CCL_ClWorkspace * ccl_cl_workspace_new_limber(int lmax, double l_logstep, int l_linstep, int *status)
void ccl_angular_cls(ccl_cosmology *cosmo, CCL_ClWorkspace *w, CCL_ClTracer *clt1, CCL_ClTracer *clt2, int nl_out, int *l, double *cl, int *status)
static int linecount(FILE *f)
Grid< NDIM, T > sqrt(Grid< NDIM, T > lhs)
ccl_cosmology * ccl_cosmology_create(ccl_parameters params, ccl_configuration config)
double INTEGRATION_EPSREL
CCL_ClTracer * ccl_cl_tracer_number_counts_simple(ccl_cosmology *cosmo, int nz_n, double *z_n, double *n, int nz_b, double *z_b, double *b, int *status)
void ccl_cosmology_free(ccl_cosmology *cosmo)
const ccl_configuration default_config
void ccl_cl_workspace_free(CCL_ClWorkspace *w)
CCL_ClTracer * ccl_cl_tracer_cmblens(ccl_cosmology *cosmo, double z_source, int *status)
#define ASSERT_NOT_NULL(real)
ccl_parameters ccl_parameters_create_flat_lcdm(double Omega_c, double Omega_b, double h, double norm_pk, double n_s, int *status)
double INTEGRATION_LIMBER_EPSREL
static double w[2][28][111]
CCL_ClTracer * ccl_cl_tracer_lensing_simple(ccl_cosmology *cosmo, int nz_n, double *z_n, double *n, int *status)