4 #include <gsl/gsl_sf_bessel.h>
8 while (1 == scanf("%d", &lMax
)){
10 if (1 != scanf(" %lf", &x
))
12 double orig
[lMax
+1], gsl
[lMax
+2], relerr
[lMax
+1];
13 for(int l
=0; l
<= lMax
; ++l
)
14 if (1 != scanf(" %lf", orig
+l
))
16 #if defined JTEST || defined DJTEST
17 if(gsl_sf_bessel_jl_array(lMax
+1,x
,gsl
))
18 #elif defined YTEST || defined DYTEST
19 if(gsl_sf_bessel_yl_array(lMax
+1,x
,gsl
))
21 if(gsl_sf_bessel_jl_steed_array(lMax
+1,x
,gsl
))
24 #if defined DJTEST || defined DYTEST || defined DJTEST_STEED
26 for (int l
= 0; l
<= lMax
; ++l
)
27 gsl
[l
] = -gsl
[l
+1] + (l
/x
) * gsl
[l
];
29 // todo varianta 10.51.2
32 for (int l
= 0; l
<= lMax
; ++l
)
33 relerr
[l
] = fabs(gsl
[l
] - orig
[l
]) / (fabs(gsl
[l
]) + fabs(orig
[l
])) * 2;
34 printf("x = %.16g\n", x
);
36 for (int l
= 0; l
<= lMax
; ++l
)
37 printf("%.16g ", orig
[l
]);
39 for (int l
= 0; l
<= lMax
; ++l
)
40 printf("%.16g ", gsl
[l
]);
42 for (int l
= 0; l
<= lMax
; ++l
)
43 printf("%.16g ", relerr
[l
]);