Initial qpms version metadata in library and output files
[qpms.git] / oldtests / gsl_leg_phase.c
blob72ef09278cac5974cce481c24a496aced746e1d6
1 #include <stddef.h>
2 #include <gsl/gsl_sf_legendre.h>
3 #include <stdio.h>
5 int main() {
6 const size_t lmax = 2;
7 const double x = .5;
8 size_t arrsiz = gsl_sf_legendre_array_n(lmax);
9 double csphase = 1;
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)]);
15 csphase = -1;
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)]);
20 return 0;