2 #include <gsl/gsl_sf_legendre.h>
8 size_t arrsiz
= gsl_sf_legendre_array_n(lmax
);
10 double target
[arrsiz
];
11 printf("lmax = %zd, x = %g, csphase = %g:\n", lmax
, x
, csphase
);
12 gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE
, lmax
, x
, csphase
, target
);
13 for(int l
= 0; l
<= lmax
; ++l
) for (int m
= 0; m
<= l
; ++m
)
14 printf("P_%d^%d(%g)\t= %g\n", l
, m
, x
, target
[gsl_sf_legendre_array_index(l
,m
)]);
16 printf("lmax = %zd, x = %g, csphase = %g:\n", lmax
, x
, csphase
);
17 gsl_sf_legendre_array_e(GSL_SF_LEGENDRE_NONE
, lmax
, x
, csphase
, target
);
18 for(int l
= 0; l
<= lmax
; ++l
) for (int m
= 0; m
<= l
; ++m
)
19 printf("P_%d^%d(%g)\t= %g\n", l
, m
, x
, target
[gsl_sf_legendre_array_index(l
,m
)]);