/* k1.c
*
* Modified Bessel function , third kind , order one
*
*
*
* SYNOPSIS :
*
* double x , y , k1 ( ) ;
*
* y = k1 ( x ) ;
*
*
*
* DESCRIPTION :
*
* Computes the modified Bessel function of the third kind
* of order one of the argument .
*
* The range is partitioned into the two intervals [ 0 , 2 ] and
* ( 2 , infinity ) . Chebyshev polynomial expansions are employed
* in each interval .
*
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* DEC 0 , 30 3300 8 . 9 e - 17 2 . 2 e - 17
* IEEE 0 , 30 30000 1 . 2 e - 15 1 . 6 e - 16
*
* ERROR MESSAGES :
*
* message condition value returned
* k1 domain x < = 0 MAXNUM
*
*/
/* k1e.c
*
* Modified Bessel function , third kind , order one ,
* exponentially scaled
*
*
*
* SYNOPSIS :
*
* double x , y , k1e ( ) ;
*
* y = k1e ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns exponentially scaled modified Bessel function
* of the third kind of order one of the argument :
*
* k1e ( x ) = exp ( x ) * k1 ( x ) .
*
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* IEEE 0 , 30 30000 7 . 8 e - 16 1 . 2 e - 16
* See k1 ( ) .
*
*/
/*
Cephes Math Library Release 2 . 8 : June , 2000
Copyright 1984 , 1987 , 2000 by Stephen L . Moshier
*/
#include "mconf.h"
/* Chebyshev coefficients for x(K1(x) - log(x/2) I1(x))
* in the interval [ 0 , 2 ] .
*
* lim ( x - > 0 ) { x ( K1 ( x ) - log ( x / 2 ) I1 ( x ) ) } = 1 .
*/
#ifdef UNK
static double A[] =
{
-7 .02386347938628759343 E-18 ,
-2 .42744985051936593393 E-15 ,
-6 .66690169419932900609 E-13 ,
-1 .41148839263352776110 E-10 ,
-2 .21338763073472585583 E-8 ,
-2 .43340614156596823496 E-6 ,
-1 .73028895751305206302 E-4 ,
-6 .97572385963986435018 E-3 ,
-1 .22611180822657148235 E-1 ,
-3 .53155960776544875667 E-1 ,
1 .52530022733894777053 E0
};
#endif
#ifdef DEC
static unsigned short A[] = {
0122001 ,0110501 ,0164746 ,0151255 ,
0124056 ,0165213 ,0150034 ,0147377 ,
0126073 ,0124026 ,0167207 ,0001044 ,
0130033 ,0030735 ,0141061 ,0033116 ,
0131676 ,0020350 ,0121341 ,0107175 ,
0133443 ,0046631 ,0062031 ,0070716 ,
0135065 ,0067427 ,0026435 ,0164022 ,
0136344 ,0112234 ,0165752 ,0006222 ,
0137373 ,0015622 ,0017016 ,0155636 ,
0137664 ,0150333 ,0125730 ,0067240 ,
0040303 ,0036411 ,0130200 ,0043120
};
#endif
#ifdef IBMPC
static unsigned short A[] = {
0 xda56,0 x3d3c,0 x3228,0 xbc60,
0 x99e0,0 x7a03,0 xdd51,0 xbce5,
0 xe045,0 xddd0,0 x7502,0 xbd67,
0 x26ca,0 xb846,0 x663b,0 xbde3,
0 x31d0,0 x145c,0 xc41d,0 xbe57,
0 x2e3a,0 x2c83,0 x69b3,0 xbec4,
0 xbd02,0 xe5a3,0 xade2,0 xbf26,
0 x4192,0 x9d7d,0 x9293,0 xbf7c,
0 xdb74,0 x43c1,0 x6372,0 xbfbf,
0 x0dd4,0 x757b,0 x9a1b,0 xbfd6,
0 x08ca,0 x3610,0 x67a1,0 x3ff8
};
#endif
#ifdef MIEEE
static unsigned short A[] = {
0 xbc60,0 x3228,0 x3d3c,0 xda56,
0 xbce5,0 xdd51,0 x7a03,0 x99e0,
0 xbd67,0 x7502,0 xddd0,0 xe045,
0 xbde3,0 x663b,0 xb846,0 x26ca,
0 xbe57,0 xc41d,0 x145c,0 x31d0,
0 xbec4,0 x69b3,0 x2c83,0 x2e3a,
0 xbf26,0 xade2,0 xe5a3,0 xbd02,
0 xbf7c,0 x9293,0 x9d7d,0 x4192,
0 xbfbf,0 x6372,0 x43c1,0 xdb74,
0 xbfd6,0 x9a1b,0 x757b,0 x0dd4,
0 x3ff8,0 x67a1,0 x3610,0 x08ca
};
#endif
/* Chebyshev coefficients for exp(x) sqrt(x) K1(x)
* in the interval [ 2 , infinity ] .
*
* lim ( x - > inf ) { exp ( x ) sqrt ( x ) K1 ( x ) } = sqrt ( pi / 2 ) .
*/
#ifdef UNK
static double B[] =
{
-5 .75674448366501715755 E-18 ,
1 .79405087314755922667 E-17 ,
-5 .68946255844285935196 E-17 ,
1 .83809354436663880070 E-16 ,
-6 .05704724837331885336 E-16 ,
2 .03870316562433424052 E-15 ,
-7 .01983709041831346144 E-15 ,
2 .47715442448130437068 E-14 ,
-8 .97670518232499435011 E-14 ,
3 .34841966607842919884 E-13 ,
-1 .28917396095102890680 E-12 ,
5 .13963967348173025100 E-12 ,
-2 .12996783842756842877 E-11 ,
9 .21831518760500529508 E-11 ,
-4 .19035475934189648750 E-10 ,
2 .01504975519703286596 E-9 ,
-1 .03457624656780970260 E-8 ,
5 .74108412545004946722 E-8 ,
-3 .50196060308781257119 E-7 ,
2 .40648494783721712015 E-6 ,
-1 .93619797416608296024 E-5 ,
1 .95215518471351631108 E-4 ,
-2 .85781685962277938680 E-3 ,
1 .03923736576817238437 E-1 ,
2 .72062619048444266945 E0
};
#endif
#ifdef DEC
static unsigned short B[] = {
0121724 ,0061352 ,0013041 ,0150076 ,
0022245 ,0074324 ,0016172 ,0173232 ,
0122603 ,0030250 ,0135670 ,0165221 ,
0023123 ,0165362 ,0023561 ,0060124 ,
0123456 ,0112436 ,0141654 ,0073623 ,
0024022 ,0163557 ,0077564 ,0006753 ,
0124374 ,0165221 ,0131014 ,0026524 ,
0024737 ,0017512 ,0144250 ,0175451 ,
0125312 ,0021456 ,0123136 ,0076633 ,
0025674 ,0077720 ,0020125 ,0102607 ,
0126265 ,0067543 ,0007744 ,0043701 ,
0026664 ,0152702 ,0033002 ,0074202 ,
0127273 ,0055234 ,0120016 ,0071733 ,
0027712 ,0133200 ,0042441 ,0075515 ,
0130346 ,0057000 ,0015456 ,0074470 ,
0031012 ,0074441 ,0051636 ,0111155 ,
0131461 ,0136444 ,0177417 ,0002101 ,
0032166 ,0111743 ,0032176 ,0021410 ,
0132674 ,0001224 ,0076555 ,0027060 ,
0033441 ,0077430 ,0135226 ,0106663 ,
0134242 ,0065610 ,0167155 ,0113447 ,
0035114 ,0131304 ,0043664 ,0102163 ,
0136073 ,0045065 ,0171465 ,0122123 ,
0037324 ,0152767 ,0147401 ,0017732 ,
0040456 ,0017275 ,0050061 ,0062120 ,
};
#endif
#ifdef IBMPC
static unsigned short B[] = {
0 x3a08,0 x42c4,0 x8c5d,0 xbc5a,
0 x5ed3,0 x838f,0 xaf1a,0 x3c74,
0 x1d52,0 x1777,0 x6615,0 xbc90,
0 x2c0b,0 x44ee,0 x7d5e,0 x3caa,
0 x8ef2,0 xd875,0 xd2a3,0 xbcc5,
0 x81bd,0 xefee,0 x5ced,0 x3ce2,
0 x85ab,0 x3641,0 x9d52,0 xbcff,
0 x1f65,0 x5915,0 xe3e9,0 x3d1b,
0 xcfb3,0 xd4cb,0 x4465,0 xbd39,
0 xb0b1,0 x040a,0 x8ffa,0 x3d57,
0 x88f8,0 x61fc,0 xadec,0 xbd76,
0 x4f10,0 x46c0,0 x9ab8,0 x3d96,
0 xce7b,0 x9401,0 x6b53,0 xbdb7,
0 x2f6a,0 x08a4,0 x56d0,0 x3dd9,
0 xcf27,0 x0365,0 xcbc0,0 xbdfc,
0 xd24e,0 x2a73,0 x4f24,0 x3e21,
0 xe088,0 x9fe1,0 x37a4,0 xbe46,
0 xc461,0 x668f,0 xd27c,0 x3e6e,
0 xa5c6,0 x8fad,0 x8052,0 xbe97,
0 xd1b6,0 x1752,0 x2fe3,0 x3ec4,
0 xb2e5,0 x1dcd,0 x4d71,0 xbef4,
0 x908e,0 x88f6,0 x9658,0 x3f29,
0 xb48a,0 xbe66,0 x6946,0 xbf67,
0 x23fb,0 xf9e0,0 x9abe,0 x3fba,
0 x2c8a,0 xaa06,0 xc3d7,0 x4005
};
#endif
#ifdef MIEEE
static unsigned short B[] = {
0 xbc5a,0 x8c5d,0 x42c4,0 x3a08,
0 x3c74,0 xaf1a,0 x838f,0 x5ed3,
0 xbc90,0 x6615,0 x1777,0 x1d52,
0 x3caa,0 x7d5e,0 x44ee,0 x2c0b,
0 xbcc5,0 xd2a3,0 xd875,0 x8ef2,
0 x3ce2,0 x5ced,0 xefee,0 x81bd,
0 xbcff,0 x9d52,0 x3641,0 x85ab,
0 x3d1b,0 xe3e9,0 x5915,0 x1f65,
0 xbd39,0 x4465,0 xd4cb,0 xcfb3,
0 x3d57,0 x8ffa,0 x040a,0 xb0b1,
0 xbd76,0 xadec,0 x61fc,0 x88f8,
0 x3d96,0 x9ab8,0 x46c0,0 x4f10,
0 xbdb7,0 x6b53,0 x9401,0 xce7b,
0 x3dd9,0 x56d0,0 x08a4,0 x2f6a,
0 xbdfc,0 xcbc0,0 x0365,0 xcf27,
0 x3e21,0 x4f24,0 x2a73,0 xd24e,
0 xbe46,0 x37a4,0 x9fe1,0 xe088,
0 x3e6e,0 xd27c,0 x668f,0 xc461,
0 xbe97,0 x8052,0 x8fad,0 xa5c6,
0 x3ec4,0 x2fe3,0 x1752,0 xd1b6,
0 xbef4,0 x4d71,0 x1dcd,0 xb2e5,
0 x3f29,0 x9658,0 x88f6,0 x908e,
0 xbf67,0 x6946,0 xbe66,0 xb48a,
0 x3fba,0 x9abe,0 xf9e0,0 x23fb,
0 x4005,0 xc3d7,0 xaa06,0 x2c8a
};
#endif
#ifdef ANSIPROT
extern double chbevl ( double , void *, int );
extern double exp ( double );
extern double i1 ( double );
extern double log ( double );
extern double sqrt ( double );
#else
double chbevl(), exp(), i1(), log(), sqrt();
#endif
extern double PI;
extern double MINLOG, MAXNUM;
double k1(x)
double x;
{
double y, z;
z = 0 .5 * x;
if ( z <= 0 .0 )
{
mtherr( "k1" , DOMAIN );
return ( MAXNUM );
}
if ( x <= 2 .0 )
{
y = x * x - 2 .0 ;
y = log(z) * i1(x) + chbevl( y, A, 11 ) / x;
return ( y );
}
return ( exp(-x) * chbevl( 8 .0 /x - 2 .0 , B, 25 ) / sqrt(x) );
}
double k1e( x )
double x;
{
double y;
if ( x <= 0 .0 )
{
mtherr( "k1e" , DOMAIN );
return ( MAXNUM );
}
if ( x <= 2 .0 )
{
y = x * x - 2 .0 ;
y = log( 0 .5 * x ) * i1(x) + chbevl( y, A, 11 ) / x;
return ( y * exp(x) );
}
return ( chbevl( 8 .0 /x - 2 .0 , B, 25 ) / sqrt(x) );
}
Messung V0.5 in Prozent C=99 H=100 G=99
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-17)
¤
*© Formatika GbR, Deutschland