/* BESSEL.C: This program illustrates Bessel functions, * including: _j0 _j1 _jn _y0 _y1 _yn */ #include #include #include #include int main() { double x = 2.3870; int n = 3, c; printf( "Bessel functions for x = %f:\n", x ); printf( " Kind\t\tOrder\tFunction\tResult\n\n" ); printf( " First\t\t0\tgsl_sf_bessel_J0( x )\t%f\n", gsl_sf_bessel_J0( x ) ); printf( " First\t\t1\tgsl_sf_bessel_J1( x )\t%f\n", gsl_sf_bessel_J1( x ) ); for( c = 2; c < 5; c++ ) printf( " First\t\t%d\tgsl_sf_bessel_Jn( n, x )\t%f\n", c, gsl_sf_bessel_Jn( n, x ) ); printf( " Second\t\t0\tgsl_sf_bessel_K0( x )\t\t%f\n", gsl_sf_bessel_K0( x ) ); printf( " Second\t\t1\tgsl_sf_bessel_K1( x )\t\t%f\n", gsl_sf_bessel_K1( x ) ); for( c = 2; c < 5; c++ ) printf( " Second\t\t%d\tgsl_sf_bessel_Yn( n, x )\t%f\n", c, gsl_sf_bessel_Yn( c, x ) ); return(0); }