3 * Modified Bessel function, third kind, order one
17 * Computes the modified Bessel function of the third kind
18 * of order one of the argument.
20 * The range is partitioned into the two intervals [0,2] and
21 * (2, infinity). Chebyshev polynomial expansions are employed
29 * arithmetic domain # trials peak rms
30 * IEEE 0, 30 30000 4.6e-7 7.6e-8
34 * message condition value returned
35 * k1 domain x <= 0 MAXNUM
40 * Modified Bessel function, third kind, order one,
41 * exponentially scaled
55 * Returns exponentially scaled modified Bessel function
56 * of the third kind of order one of the argument:
58 * k1e(x) = exp(x) * k1(x).
65 * arithmetic domain # trials peak rms
66 * IEEE 0, 30 30000 4.9e-7 6.7e-8
72 Cephes Math Library Release 2.2: June, 1992
73 Copyright 1984, 1987, 1992 by Stephen L. Moshier
74 Direct inquiries to 30 Frost Street, Cambridge, MA 02140
79 /* Chebyshev coefficients for x(K1(x) - log(x/2) I1(x))
80 * in the interval [0,2].
82 * lim(x->0){ x(K1(x) - log(x/2) I1(x)) } = 1.
85 #define MINNUMF 6.0e-39
88 -2.21338763073472585583E-8f,
89 -2.43340614156596823496E-6f,
90 -1.73028895751305206302E-4f,
91 -6.97572385963986435018E-3f,
92 -1.22611180822657148235E-1f,
93 -3.53155960776544875667E-1f,
94 1.52530022733894777053E0f
100 /* Chebyshev coefficients for exp(x) sqrt(x) K1(x)
101 * in the interval [2,infinity].
103 * lim(x->inf){ exp(x) sqrt(x) K1(x) } = sqrt(pi/2).
108 2.01504975519703286596E-9f,
109 -1.03457624656780970260E-8f,
110 5.74108412545004946722E-8f,
111 -3.50196060308781257119E-7f,
112 2.40648494783721712015E-6f,
113 -1.93619797416608296024E-5f,
114 1.95215518471351631108E-4f,
115 -2.85781685962277938680E-3f,
116 1.03923736576817238437E-1f,
117 2.72062619048444266945E0f
122 extern float MAXNUMF;
124 float chbevlf(float, float *, int);
125 float expf(float), i1f(float), logf(float), sqrtf(float);
127 float chbevlf(), expf(), i1f(), logf(), sqrtf();
142 mtherr( "k1f", DOMAIN );
149 y = logf( 0.5f * x ) * i1f(x) + chbevlf( y, A, 7 ) / x;
153 return( expf(-x) * chbevlf( 8.0f/x - 2.0f, B, 10 ) / sqrtf(x) );
160 float k1ef( float xx )
171 mtherr( "k1ef", DOMAIN );
178 y = logf( 0.5f * x ) * i1f(x) + chbevlf( y, A, 7 ) / x;
179 return( y * expf(x) );
182 return( chbevlf( 8.0f/x - 2.0f, B, 10 ) / sqrtf(x) );