/* i0.c
*
* Modified Bessel function of order zero
*
*
*
* SYNOPSIS :
*
* double x , y , i0 ( ) ;
*
* y = i0 ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns modified Bessel function of order zero of the
* argument .
*
* The function is defined as i0 ( x ) = j0 ( ix ) .
*
* The range is partitioned into the two intervals [ 0 , 8 ] and
* ( 8 , infinity ) . Chebyshev polynomial expansions are employed
* in each interval .
*
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* DEC 0 , 30 6000 8 . 2 e - 17 1 . 9 e - 17
* IEEE 0 , 30 30000 5 . 8 e - 16 1 . 4 e - 16
*
*/
/* i0e.c
*
* Modified Bessel function of order zero ,
* exponentially scaled
*
*
*
* SYNOPSIS :
*
* double x , y , i0e ( ) ;
*
* y = i0e ( x ) ;
*
*
*
* DESCRIPTION :
*
* Returns exponentially scaled modified Bessel function
* of order zero of the argument .
*
* The function is defined as i0e ( x ) = exp ( - | x | ) j0 ( ix ) .
*
*
*
* ACCURACY :
*
* Relative error :
* arithmetic domain # trials peak rms
* IEEE 0 , 30 30000 5 . 4 e - 16 1 . 2 e - 16
* See i0 ( ) .
*
*/
/* i0.c */
/*
Cephes Math Library Release 2 . 8 : June , 2000
Copyright 1984 , 1987 , 2000 by Stephen L . Moshier
*/
#include "mconf.h"
/* Chebyshev coefficients for exp(-x) I0(x)
* in the interval [ 0 , 8 ] .
*
* lim ( x - > 0 ) { exp ( - x ) I0 ( x ) } = 1 .
*/
#ifdef UNK
static double A[] =
{
-4 .41534164647933937950 E-18 ,
3 .33079451882223809783 E-17 ,
-2 .43127984654795469359 E-16 ,
1 .71539128555513303061 E-15 ,
-1 .16853328779934516808 E-14 ,
7 .67618549860493561688 E-14 ,
-4 .85644678311192946090 E-13 ,
2 .95505266312963983461 E-12 ,
-1 .72682629144155570723 E-11 ,
9 .67580903537323691224 E-11 ,
-5 .18979560163526290666 E-10 ,
2 .65982372468238665035 E-9 ,
-1 .30002500998624804212 E-8 ,
6 .04699502254191894932 E-8 ,
-2 .67079385394061173391 E-7 ,
1 .11738753912010371815 E-6 ,
-4 .41673835845875056359 E-6 ,
1 .64484480707288970893 E-5 ,
-5 .75419501008210370398 E-5 ,
1 .88502885095841655729 E-4 ,
-5 .76375574538582365885 E-4 ,
1 .63947561694133579842 E-3 ,
-4 .32430999505057594430 E-3 ,
1 .05464603945949983183 E-2 ,
-2 .37374148058994688156 E-2 ,
4 .93052842396707084878 E-2 ,
-9 .49010970480476444210 E-2 ,
1 .71620901522208775349 E-1 ,
-3 .04682672343198398683 E-1 ,
6 .76795274409476084995 E-1
};
#endif
#ifdef DEC
static unsigned short A[] = {
0121642 ,0162671 ,0004646 ,0103567 ,
0022431 ,0115424 ,0135755 ,0026104 ,
0123214 ,0023533 ,0110365 ,0156635 ,
0023767 ,0033304 ,0117662 ,0172716 ,
0124522 ,0100426 ,0012277 ,0157531 ,
0025254 ,0155062 ,0054461 ,0030465 ,
0126010 ,0131143 ,0013560 ,0153604 ,
0026517 ,0170577 ,0006336 ,0114437 ,
0127227 ,0162253 ,0152243 ,0052734 ,
0027724 ,0142766 ,0061641 ,0160200 ,
0130416 ,0123760 ,0116564 ,0125262 ,
0031066 ,0144035 ,0021246 ,0054641 ,
0131537 ,0053664 ,0060131 ,0102530 ,
0032201 ,0155664 ,0165153 ,0020652 ,
0132617 ,0061434 ,0074423 ,0176145 ,
0033225 ,0174444 ,0136147 ,0122542 ,
0133624 ,0031576 ,0056453 ,0020470 ,
0034211 ,0175305 ,0172321 ,0041314 ,
0134561 ,0054462 ,0147040 ,0165315 ,
0035105 ,0124333 ,0120203 ,0162532 ,
0135427 ,0013750 ,0174257 ,0055221 ,
0035726 ,0161654 ,0050220 ,0100162 ,
0136215 ,0131361 ,0000325 ,0041110 ,
0036454 ,0145417 ,0117357 ,0017352 ,
0136702 ,0072367 ,0104415 ,0133574 ,
0037111 ,0172126 ,0072505 ,0014544 ,
0137302 ,0055601 ,0120550 ,0033523 ,
0037457 ,0136543 ,0136544 ,0043002 ,
0137633 ,0177536 ,0001276 ,0066150 ,
0040055 ,0041164 ,0100655 ,0010521
};
#endif
#ifdef IBMPC
static unsigned short A[] = {
0 xd0ef,0 x2134,0 x5cb7,0 xbc54,
0 xa589,0 x977d,0 x3362,0 x3c83,
0 xbbb4,0 x721e,0 x84eb,0 xbcb1,
0 x5eba,0 x93f6,0 xe6d8,0 x3cde,
0 xfbeb,0 xc297,0 x5022,0 xbd0a,
0 x2627,0 x4b26,0 x9b46,0 x3d35,
0 x1af0,0 x62ee,0 x164c,0 xbd61,
0 xd324,0 xe19b,0 xfe2f,0 x3d89,
0 x6abc,0 x7a94,0 xfc95,0 xbdb2,
0 x3c10,0 xcc74,0 x98be,0 x3dda,
0 x9556,0 x13ae,0 xd4fe,0 xbe01,
0 xcb34,0 xa454,0 xd903,0 x3e26,
0 x30ab,0 x8c0b,0 xeaf6,0 xbe4b,
0 x6435,0 x9d4d,0 x3b76,0 x3e70,
0 x7f8d,0 x8f22,0 xec63,0 xbe91,
0 xf4ac,0 x978c,0 xbf24,0 x3eb2,
0 x6427,0 xcba5,0 x866f,0 xbed2,
0 x2859,0 xbe9a,0 x3f58,0 x3ef1,
0 x1d5a,0 x59c4,0 x2b26,0 xbf0e,
0 x7cab,0 x7410,0 xb51b,0 x3f28,
0 xeb52,0 x1f15,0 xe2fd,0 xbf42,
0 x100e,0 x8a12,0 xdc75,0 x3f5a,
0 xa849,0 x201a,0 xb65e,0 xbf71,
0 xe3dd,0 xf3dd,0 x9961,0 x3f85,
0 xb6f0,0 xf121,0 x4e9e,0 xbf98,
0 xa32d,0 xcea8,0 x3e8a,0 x3fa9,
0 x06ea,0 x342d,0 x4b70,0 xbfb8,
0 x88c0,0 x77ac,0 xf7ac,0 x3fc5,
0 xcd8d,0 xc057,0 x7feb,0 xbfd3,
0 xa22a,0 x9035,0 xa84e,0 x3fe5,
};
#endif
#ifdef MIEEE
static unsigned short A[] = {
0 xbc54,0 x5cb7,0 x2134,0 xd0ef,
0 x3c83,0 x3362,0 x977d,0 xa589,
0 xbcb1,0 x84eb,0 x721e,0 xbbb4,
0 x3cde,0 xe6d8,0 x93f6,0 x5eba,
0 xbd0a,0 x5022,0 xc297,0 xfbeb,
0 x3d35,0 x9b46,0 x4b26,0 x2627,
0 xbd61,0 x164c,0 x62ee,0 x1af0,
0 x3d89,0 xfe2f,0 xe19b,0 xd324,
0 xbdb2,0 xfc95,0 x7a94,0 x6abc,
0 x3dda,0 x98be,0 xcc74,0 x3c10,
0 xbe01,0 xd4fe,0 x13ae,0 x9556,
0 x3e26,0 xd903,0 xa454,0 xcb34,
0 xbe4b,0 xeaf6,0 x8c0b,0 x30ab,
0 x3e70,0 x3b76,0 x9d4d,0 x6435,
0 xbe91,0 xec63,0 x8f22,0 x7f8d,
0 x3eb2,0 xbf24,0 x978c,0 xf4ac,
0 xbed2,0 x866f,0 xcba5,0 x6427,
0 x3ef1,0 x3f58,0 xbe9a,0 x2859,
0 xbf0e,0 x2b26,0 x59c4,0 x1d5a,
0 x3f28,0 xb51b,0 x7410,0 x7cab,
0 xbf42,0 xe2fd,0 x1f15,0 xeb52,
0 x3f5a,0 xdc75,0 x8a12,0 x100e,
0 xbf71,0 xb65e,0 x201a,0 xa849,
0 x3f85,0 x9961,0 xf3dd,0 xe3dd,
0 xbf98,0 x4e9e,0 xf121,0 xb6f0,
0 x3fa9,0 x3e8a,0 xcea8,0 xa32d,
0 xbfb8,0 x4b70,0 x342d,0 x06ea,
0 x3fc5,0 xf7ac,0 x77ac,0 x88c0,
0 xbfd3,0 x7feb,0 xc057,0 xcd8d,
0 x3fe5,0 xa84e,0 x9035,0 xa22a
};
#endif
/* Chebyshev coefficients for exp(-x) sqrt(x) I0(x)
* in the inverted interval [ 8 , infinity ] .
*
* lim ( x - > inf ) { exp ( - x ) sqrt ( x ) I0 ( x ) } = 1 / sqrt ( 2 pi ) .
*/
#ifdef UNK
static double B[] =
{
-7 .23318048787475395456 E-18 ,
-4 .83050448594418207126 E-18 ,
4 .46562142029675999901 E-17 ,
3 .46122286769746109310 E-17 ,
-2 .82762398051658348494 E-16 ,
-3 .42548561967721913462 E-16 ,
1 .77256013305652638360 E-15 ,
3 .81168066935262242075 E-15 ,
-9 .55484669882830764870 E-15 ,
-4 .15056934728722208663 E-14 ,
1 .54008621752140982691 E-14 ,
3 .85277838274214270114 E-13 ,
7 .18012445138366623367 E-13 ,
-1 .79417853150680611778 E-12 ,
-1 .32158118404477131188 E-11 ,
-3 .14991652796324136454 E-11 ,
1 .18891471078464383424 E-11 ,
4 .94060238822496958910 E-10 ,
3 .39623202570838634515 E-9 ,
2 .26666899049817806459 E-8 ,
2 .04891858946906374183 E-7 ,
2 .89137052083475648297 E-6 ,
6 .88975834691682398426 E-5 ,
3 .36911647825569408990 E-3 ,
8 .04490411014108831608 E-1
};
#endif
#ifdef DEC
static unsigned short B[] = {
0122005 ,0066672 ,0123124 ,0054311 ,
0121662 ,0033323 ,0030214 ,0104602 ,
0022515 ,0170300 ,0113314 ,0020413 ,
0022437 ,0117350 ,0035402 ,0007146 ,
0123243 ,0000135 ,0057220 ,0177435 ,
0123305 ,0073476 ,0144106 ,0170702 ,
0023777 ,0071755 ,0017527 ,0154373 ,
0024211 ,0052214 ,0102247 ,0033270 ,
0124454 ,0017763 ,0171453 ,0012322 ,
0125072 ,0166316 ,0075505 ,0154616 ,
0024612 ,0133770 ,0065376 ,0025045 ,
0025730 ,0162143 ,0056036 ,0001632 ,
0026112 ,0015077 ,0150464 ,0063542 ,
0126374 ,0101030 ,0014274 ,0065457 ,
0127150 ,0077271 ,0125763 ,0157617 ,
0127412 ,0104350 ,0040713 ,0120445 ,
0027121 ,0023765 ,0057500 ,0001165 ,
0030407 ,0147146 ,0003643 ,0075644 ,
0031151 ,0061445 ,0044422 ,0156065 ,
0031702 ,0132224 ,0003266 ,0125551 ,
0032534 ,0000076 ,0147153 ,0005555 ,
0033502 ,0004536 ,0004016 ,0026055 ,
0034620 ,0076433 ,0142314 ,0171215 ,
0036134 ,0146145 ,0013454 ,0101104 ,
0040115 ,0171425 ,0062500 ,0047133
};
#endif
#ifdef IBMPC
static unsigned short B[] = {
0 x8b19,0 x54ca,0 xadb7,0 xbc60,
0 x9130,0 x6611,0 x46da,0 xbc56,
0 x8421,0 x12d9,0 xbe18,0 x3c89,
0 x41cd,0 x0760,0 xf3dd,0 x3c83,
0 x1fe4,0 xabd2,0 x600b,0 xbcb4,
0 xde38,0 xd908,0 xaee7,0 xbcb8,
0 xfb1f,0 xa3ea,0 xee7d,0 x3cdf,
0 xe6d7,0 x9094,0 x2a91,0 x3cf1,
0 x629a,0 x7e65,0 x83fe,0 xbd05,
0 xbb32,0 xcf68,0 x5d99,0 xbd27,
0 xc545,0 x0d5f,0 x56ff,0 x3d11,
0 xc073,0 x6b83,0 x1c8c,0 x3d5b,
0 x8cec,0 xfa26,0 x4347,0 x3d69,
0 x8d66,0 x0317,0 x9043,0 xbd7f,
0 x7bf2,0 x357e,0 x0fd7,0 xbdad,
0 x7425,0 x0839,0 x511d,0 xbdc1,
0 x004f,0 xabe8,0 x24fe,0 x3daa,
0 x6f75,0 xc0f4,0 xf9cc,0 x3e00,
0 x5b87,0 xa922,0 x2c64,0 x3e2d,
0 xd56d,0 x80d6,0 x5692,0 x3e58,
0 x616e,0 xd9cd,0 x8007,0 x3e8b,
0 xc586,0 xc101,0 x412b,0 x3ec8,
0 x9e52,0 x7899,0 x0fa3,0 x3f12,
0 x9049,0 xa2e5,0 x998c,0 x3f6b,
0 x09cb,0 xaca8,0 xbe62,0 x3fe9
};
#endif
#ifdef MIEEE
static unsigned short B[] = {
0 xbc60,0 xadb7,0 x54ca,0 x8b19,
0 xbc56,0 x46da,0 x6611,0 x9130,
0 x3c89,0 xbe18,0 x12d9,0 x8421,
0 x3c83,0 xf3dd,0 x0760,0 x41cd,
0 xbcb4,0 x600b,0 xabd2,0 x1fe4,
0 xbcb8,0 xaee7,0 xd908,0 xde38,
0 x3cdf,0 xee7d,0 xa3ea,0 xfb1f,
0 x3cf1,0 x2a91,0 x9094,0 xe6d7,
0 xbd05,0 x83fe,0 x7e65,0 x629a,
0 xbd27,0 x5d99,0 xcf68,0 xbb32,
0 x3d11,0 x56ff,0 x0d5f,0 xc545,
0 x3d5b,0 x1c8c,0 x6b83,0 xc073,
0 x3d69,0 x4347,0 xfa26,0 x8cec,
0 xbd7f,0 x9043,0 x0317,0 x8d66,
0 xbdad,0 x0fd7,0 x357e,0 x7bf2,
0 xbdc1,0 x511d,0 x0839,0 x7425,
0 x3daa,0 x24fe,0 xabe8,0 x004f,
0 x3e00,0 xf9cc,0 xc0f4,0 x6f75,
0 x3e2d,0 x2c64,0 xa922,0 x5b87,
0 x3e58,0 x5692,0 x80d6,0 xd56d,
0 x3e8b,0 x8007,0 xd9cd,0 x616e,
0 x3ec8,0 x412b,0 xc101,0 xc586,
0 x3f12,0 x0fa3,0 x7899,0 x9e52,
0 x3f6b,0 x998c,0 xa2e5,0 x9049,
0 x3fe9,0 xbe62,0 xaca8,0 x09cb
};
#endif
#ifdef ANSIPROT
extern double chbevl ( double , void *, int );
extern double exp ( double );
extern double sqrt ( double );
#else
double chbevl(), exp(), sqrt();
#endif
double i0(x)
double x;
{
double y;
if ( x < 0 )
x = -x;
if ( x <= 8 .0 )
{
y = (x/2 .0 ) - 2 .0 ;
return ( exp(x) * chbevl( y, A, 30 ) );
}
return ( exp(x) * chbevl( 32 .0 /x - 2 .0 , B, 25 ) / sqrt(x) );
}
double i0e( x )
double x;
{
double y;
if ( x < 0 )
x = -x;
if ( x <= 8 .0 )
{
y = (x/2 .0 ) - 2 .0 ;
return ( chbevl( y, A, 30 ) );
}
return ( chbevl( 32 .0 /x - 2 .0 , B, 25 ) / sqrt(x) );
}
Messung V0.5 in Prozent C=99 H=100 G=99