/* k0.c
*
* Modified Bessel function , third kind , order zero
*
*
*
* SYNOPSIS :
*
* double x , y , k0 ( ) ;
*
* y = k0 ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns modified Bessel function of the third kind
* of order zero of the argument .
*
* The range is partitioned into the two intervals [ 0 , 8 ] and
* ( 8 , infinity ) . Chebyshev polynomial expansions are employed
* in each interval .
*
*
*
* ACCURACY :
*
* Tested at 2000 random points between 0 and 8 . Peak absolute
* error ( relative when K0 > 1 ) was 1 . 46 e - 14 ; rms , 4 . 26 e - 15 .
* Relative error :
* arithmetic domain # trials peak rms
* DEC 0 , 30 3100 1 . 3 e - 16 2 . 1 e - 17
* IEEE 0 , 30 30000 1 . 2 e - 15 1 . 6 e - 16
*
* ERROR MESSAGES :
*
* message condition value returned
* K0 domain x < = 0 MAXNUM
*
*/
/* k0e()
*
* Modified Bessel function , third kind , order zero ,
* exponentially scaled
*
*
*
* SYNOPSIS :
*
* double x , y , k0e ( ) ;
*
* y = k0e ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns exponentially scaled modified Bessel function
* of the third kind of order zero of the argument .
*
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* IEEE 0 , 30 30000 1 . 4 e - 15 1 . 4 e - 16
* See k0 ( ) .
*
*/
/*
Cephes Math Library Release 2 . 8 : June , 2000
Copyright 1984 , 1987 , 2000 by Stephen L . Moshier
*/
#include "mconf.h"
/* Chebyshev coefficients for K0(x) + log(x/2) I0(x)
* in the interval [ 0 , 2 ] . The odd order coefficients are all
* zero ; only the even order coefficients are listed .
*
* lim ( x - > 0 ) { K0 ( x ) + log ( x / 2 ) I0 ( x ) } = - EUL .
*/
#ifdef UNK
static double A[] =
{
1 .37446543561352307156 E-16 ,
4 .25981614279661018399 E-14 ,
1 .03496952576338420167 E-11 ,
1 .90451637722020886025 E-9 ,
2 .53479107902614945675 E-7 ,
2 .28621210311945178607 E-5 ,
1 .26461541144692592338 E-3 ,
3 .59799365153615016266 E-2 ,
3 .44289899924628486886 E-1 ,
-5 .35327393233902768720 E-1
};
#endif
#ifdef DEC
static unsigned short A[] = {
0023036 ,0073417 ,0032477 ,0165673 ,
0025077 ,0154126 ,0016046 ,0012517 ,
0027066 ,0011342 ,0035211 ,0005041 ,
0031002 ,0160233 ,0037454 ,0050224 ,
0032610 ,0012747 ,0037712 ,0173741 ,
0034277 ,0144007 ,0172147 ,0162375 ,
0035645 ,0140563 ,0125431 ,0165626 ,
0037023 ,0057662 ,0125124 ,0102051 ,
0037660 ,0043304 ,0004411 ,0166707 ,
0140011 ,0005467 ,0047227 ,0130370
};
#endif
#ifdef IBMPC
static unsigned short A[] = {
0 xfd77,0 xe6a7,0 xcee1,0 x3ca3,
0 xc2aa,0 xc384,0 xfb0a,0 x3d27,
0 x2144,0 x4751,0 xc25c,0 x3da6,
0 x8a13,0 x67e5,0 x5c13,0 x3e20,
0 x5efc,0 xe7f9,0 x02bc,0 x3e91,
0 xfca0,0 xfe8c,0 xf900,0 x3ef7,
0 x3d73,0 x7563,0 xb82e,0 x3f54,
0 x9085,0 x554a,0 x6bf6,0 x3fa2,
0 x3db9,0 x8121,0 x08d8,0 x3fd6,
0 xf61f,0 xe9d2,0 x2166,0 xbfe1
};
#endif
#ifdef MIEEE
static unsigned short A[] = {
0 x3ca3,0 xcee1,0 xe6a7,0 xfd77,
0 x3d27,0 xfb0a,0 xc384,0 xc2aa,
0 x3da6,0 xc25c,0 x4751,0 x2144,
0 x3e20,0 x5c13,0 x67e5,0 x8a13,
0 x3e91,0 x02bc,0 xe7f9,0 x5efc,
0 x3ef7,0 xf900,0 xfe8c,0 xfca0,
0 x3f54,0 xb82e,0 x7563,0 x3d73,
0 x3fa2,0 x6bf6,0 x554a,0 x9085,
0 x3fd6,0 x08d8,0 x8121,0 x3db9,
0 xbfe1,0 x2166,0 xe9d2,0 xf61f
};
#endif
/* Chebyshev coefficients for exp(x) sqrt(x) K0(x)
* in the inverted interval [ 2 , infinity ] .
*
* lim ( x - > inf ) { exp ( x ) sqrt ( x ) K0 ( x ) } = sqrt ( pi / 2 ) .
*/
#ifdef UNK
static double B[] = {
5 .30043377268626276149 E-18 ,
-1 .64758043015242134646 E-17 ,
5 .21039150503902756861 E-17 ,
-1 .67823109680541210385 E-16 ,
5 .51205597852431940784 E-16 ,
-1 .84859337734377901440 E-15 ,
6 .34007647740507060557 E-15 ,
-2 .22751332699166985548 E-14 ,
8 .03289077536357521100 E-14 ,
-2 .98009692317273043925 E-13 ,
1 .14034058820847496303 E-12 ,
-4 .51459788337394416547 E-12 ,
1 .85594911495471785253 E-11 ,
-7 .95748924447710747776 E-11 ,
3 .57739728140030116597 E-10 ,
-1 .69753450938905987466 E-9 ,
8 .57403401741422608519 E-9 ,
-4 .66048989768794782956 E-8 ,
2 .76681363944501510342 E-7 ,
-1 .83175552271911948767 E-6 ,
1 .39498137188764993662 E-5 ,
-1 .28495495816278026384 E-4 ,
1 .56988388573005337491 E-3 ,
-3 .14481013119645005427 E-2 ,
2 .44030308206595545468 E0
};
#endif
#ifdef DEC
static unsigned short B[] = {
0021703 ,0106456 ,0076144 ,0173406 ,
0122227 ,0173144 ,0116011 ,0030033 ,
0022560 ,0044562 ,0006506 ,0067642 ,
0123101 ,0076243 ,0123273 ,0131013 ,
0023436 ,0157713 ,0056243 ,0141331 ,
0124005 ,0032207 ,0063726 ,0164664 ,
0024344 ,0066342 ,0051756 ,0162300 ,
0124710 ,0121365 ,0154053 ,0077022 ,
0025264 ,0161166 ,0066246 ,0077420 ,
0125647 ,0141671 ,0006443 ,0103212 ,
0026240 ,0076431 ,0077147 ,0160445 ,
0126636 ,0153741 ,0174002 ,0105031 ,
0027243 ,0040102 ,0035375 ,0163073 ,
0127656 ,0176256 ,0113476 ,0044653 ,
0030304 ,0125544 ,0006377 ,0130104 ,
0130751 ,0047257 ,0110537 ,0127324 ,
0031423 ,0046400 ,0014772 ,0012164 ,
0132110 ,0025240 ,0155247 ,0112570 ,
0032624 ,0105314 ,0007437 ,0021574 ,
0133365 ,0155243 ,0174306 ,0116506 ,
0034152 ,0004776 ,0061643 ,0102504 ,
0135006 ,0136277 ,0036104 ,0175023 ,
0035715 ,0142217 ,0162474 ,0115022 ,
0137000 ,0147671 ,0065177 ,0134356 ,
0040434 ,0026754 ,0175163 ,0044070
};
#endif
#ifdef IBMPC
static unsigned short B[] = {
0 x9ee1,0 xcf8c,0 x71a5,0 x3c58,
0 x2603,0 x9381,0 xfecc,0 xbc72,
0 xcdf4,0 x41a8,0 x092e,0 x3c8e,
0 x7641,0 x74d7,0 x2f94,0 xbca8,
0 x785b,0 x6b94,0 xdbf9,0 x3cc3,
0 xdd36,0 xecfa,0 xa690,0 xbce0,
0 xdc98,0 x4a7d,0 x8d9c,0 x3cfc,
0 x6fc2,0 xbb05,0 x145e,0 xbd19,
0 xcfe2,0 xcd94,0 x9c4e,0 x3d36,
0 x70d1,0 x21a4,0 xf877,0 xbd54,
0 xfc25,0 x2fcc,0 x0fa3,0 x3d74,
0 x5143,0 x3f00,0 xdafc,0 xbd93,
0 xbcc7,0 x475f,0 x6808,0 x3db4,
0 xc935,0 xd2e7,0 xdf95,0 xbdd5,
0 xf608,0 x819f,0 x956c,0 x3df8,
0 xf5db,0 xf22b,0 x29d5,0 xbe1d,
0 x428e,0 x033f,0 x69a0,0 x3e42,
0 xf2af,0 x1b54,0 x0554,0 xbe69,
0 xe46f,0 x81e3,0 x9159,0 x3e92,
0 xd3a9,0 x7f18,0 xbb54,0 xbebe,
0 x70a9,0 xcc74,0 x413f,0 x3eed,
0 x9f42,0 xe788,0 xd797,0 xbf20,
0 x9342,0 xfca7,0 xb891,0 x3f59,
0 xf71e,0 x2d4f,0 x19f7,0 xbfa0,
0 x6907,0 x9f4e,0 x85bd,0 x4003
};
#endif
#ifdef MIEEE
static unsigned short B[] = {
0 x3c58,0 x71a5,0 xcf8c,0 x9ee1,
0 xbc72,0 xfecc,0 x9381,0 x2603,
0 x3c8e,0 x092e,0 x41a8,0 xcdf4,
0 xbca8,0 x2f94,0 x74d7,0 x7641,
0 x3cc3,0 xdbf9,0 x6b94,0 x785b,
0 xbce0,0 xa690,0 xecfa,0 xdd36,
0 x3cfc,0 x8d9c,0 x4a7d,0 xdc98,
0 xbd19,0 x145e,0 xbb05,0 x6fc2,
0 x3d36,0 x9c4e,0 xcd94,0 xcfe2,
0 xbd54,0 xf877,0 x21a4,0 x70d1,
0 x3d74,0 x0fa3,0 x2fcc,0 xfc25,
0 xbd93,0 xdafc,0 x3f00,0 x5143,
0 x3db4,0 x6808,0 x475f,0 xbcc7,
0 xbdd5,0 xdf95,0 xd2e7,0 xc935,
0 x3df8,0 x956c,0 x819f,0 xf608,
0 xbe1d,0 x29d5,0 xf22b,0 xf5db,
0 x3e42,0 x69a0,0 x033f,0 x428e,
0 xbe69,0 x0554,0 x1b54,0 xf2af,
0 x3e92,0 x9159,0 x81e3,0 xe46f,
0 xbebe,0 xbb54,0 x7f18,0 xd3a9,
0 x3eed,0 x413f,0 xcc74,0 x70a9,
0 xbf20,0 xd797,0 xe788,0 x9f42,
0 x3f59,0 xb891,0 xfca7,0 x9342,
0 xbfa0,0 x19f7,0 x2d4f,0 xf71e,
0 x4003,0 x85bd,0 x9f4e,0 x6907
};
#endif
/* k0.c */
#ifdef ANSIPROT
extern double chbevl ( double , void *, int );
extern double exp ( double );
extern double i0 ( double );
extern double log ( double );
extern double sqrt ( double );
#else
double chbevl(), exp(), i0(), log(), sqrt();
#endif
extern double PI;
extern double MAXNUM;
double k0(x)
double x;
{
double y, z;
if ( x <= 0 .0 )
{
mtherr( "k0" , DOMAIN );
return ( MAXNUM );
}
if ( x <= 2 .0 )
{
y = x * x - 2 .0 ;
y = chbevl( y, A, 10 ) - log( 0 .5 * x ) * i0(x);
return ( y );
}
z = 8 .0 /x - 2 .0 ;
y = exp(-x) * chbevl( z, B, 25 ) / sqrt(x);
return (y);
}
double k0e( x )
double x;
{
double y;
if ( x <= 0 .0 )
{
mtherr( "k0e" , DOMAIN );
return ( MAXNUM );
}
if ( x <= 2 .0 )
{
y = x * x - 2 .0 ;
y = chbevl( y, A, 10 ) - log( 0 .5 * x ) * i0(x);
return ( y * exp(x) );
}
y = chbevl( 8 .0 /x - 2 .0 , B, 25 ) / sqrt(x);
return (y);
}
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