⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ei.c

📁 linux下用PCMCIA无线网卡虚拟无线AP的程序源码
💻 C
📖 第 1 页 / 共 2 页
字号:
/*							ei.c * *	Exponential integral * * * SYNOPSIS: * * double x, y, ei(); * * y = ei( x ); * * * * DESCRIPTION: * *               x *                -     t *               | |   e *    Ei(x) =   -|-   ---  dt . *             | |     t *              - *             -inf *  * Not defined for x <= 0. * See also expn.c. * * * * ACCURACY: * *                      Relative error: * arithmetic   domain     # trials      peak         rms *    IEEE       0,100       50000      8.6e-16     1.3e-16 * *//*Cephes Math Library Release 2.8:  May, 1999Copyright 1999 by Stephen L. Moshier*/#include <math.h>#ifdef ANSIPROTextern double log ( double );extern double exp ( double );extern double polevl ( double, void *, int );extern double p1evl ( double, void *, int );#elseextern double log(), exp(), polevl(), p1evl();#endif#define EUL 5.772156649015328606065e-1/* 0 < x <= 2   Ei(x) - EUL - ln(x) = x A(x)/B(x)   Theoretical peak relative error 9.73e-18  */#if UNKstatic double A[6] = {-5.350447357812542947283E0, 2.185049168816613393830E2,-4.176572384826693777058E3, 5.541176756393557601232E4,-3.313381331178144034309E5, 1.592627163384945414220E6,};static double B[6] = {  /*  1.000000000000000000000E0, */-5.250547959112862969197E1, 1.259616186786790571525E3,-1.756549581973534652631E4, 1.493062117002725991967E5,-7.294949239640527645655E5, 1.592627163384945429726E6,};#endif#if DECstatic short A[24] = {0140653,0033335,0060230,0144217,0042132,0100502,0035625,0167413,0143202,0102224,0037176,0175403,0044130,0071704,0077421,0170343,0144641,0144504,0041200,0045154,0045302,0064631,0047234,0142052,};static short B[24] = {  /* 0040200,0000000,0000000,0000000, */0141522,0002634,0070442,0142614,0042635,0071667,0146532,0027705,0143611,0035375,0156025,0114015,0044421,0147215,0106177,0046330,0145062,0014556,0144216,0103725,0045302,0064631,0047234,0142052,};#endif#if IBMPCstatic short A[24] = {0x1912,0xac13,0x66db,0xc015,0xbde1,0x4772,0x5028,0x406b,0xdf60,0x87cf,0x5092,0xc0b0,0x3e1c,0x8fe2,0x0e78,0x40eb,0x094e,0x8850,0x3928,0xc114,0x9885,0x29d3,0x4d33,0x4138,};static short B[24] = {  /* 0x0000,0x0000,0x0000,0x3ff0, */0x58b1,0x8e24,0x40b3,0xc04a,0x45f9,0xf9ab,0xae76,0x4093,0xb302,0xbb82,0x275f,0xc0d1,0xe99b,0xb18f,0x39d1,0x4102,0xd0fb,0xd911,0x432d,0xc126,0x9885,0x29d3,0x4d33,0x4138,};#endif#if MIEEEstatic short A[24] = {0xc015,0x66db,0xac13,0x1912,0x406b,0x5028,0x4772,0xbde1,0xc0b0,0x5092,0x87cf,0xdf60,0x40eb,0x0e78,0x8fe2,0x3e1c,0xc114,0x3928,0x8850,0x094e,0x4138,0x4d33,0x29d3,0x9885,};static short B[24] = {  /* 0x3ff0,0x0000,0x0000,0x0000, */0xc04a,0x40b3,0x8e24,0x58b1,0x4093,0xae76,0xf9ab,0x45f9,0xc0d1,0x275f,0xbb82,0xb302,0x4102,0x39d1,0xb18f,0xe99b,0xc126,0x432d,0xd911,0xd0fb,0x4138,0x4d33,0x29d3,0x9885,};#endif#if 0/* 0 < x <= 4   Ei(x) - EUL - ln(x) = x A(x)/B(x)   Theoretical peak relative error 4.75e-17  */#if UNKstatic double A[7] = {-6.831869820732773831942E0, 2.920190530726774500309E2,-1.195883839286649567993E4, 1.761045255472548975666E5,-2.623034438354006526979E6, 1.472430336917880803157E7,-8.205359388213261174960E7,};static double B[7] = {  /* 1.000000000000000000000E0, */-7.731946237840033971071E1, 2.751808700543578450827E3,-5.829268609072186897994E4, 7.916610857961870631379E5,-6.873926904825733094076E6, 3.523770183971164032710E7,-8.205359388213260785363E7,};#endif#if DECstatic short A[28] = {0140732,0117255,0072522,0071743,0042222,0001160,0052302,0002334,0143472,0155532,0101650,0155462,0044453,0175041,0121220,0172022,0145440,0014351,0140337,0157550,0046140,0126317,0057202,0100233,0146634,0100473,0036072,0067054,};static short B[28] = {  /* 0040200,0000000,0000000,0000000, */0141632,0121620,0111247,0010115,0043053,0176360,0067773,0027324,0144143,0132257,0121644,0036204,0045101,0043321,0057553,0151231,0145721,0143215,0147505,0050610,0046406,0065721,0072675,0152744,0146634,0100473,0036072,0067052,};#endif#if IBMPCstatic short A[28] = {0x4e7c,0xaeaa,0x53d5,0xc01b,0x409b,0x0a98,0x404e,0x4072,0x1b66,0x5075,0x5b6b,0xc0c7,0x1e82,0x3452,0x7f44,0x4105,0xfbed,0x381b,0x031d,0xc144,0x5013,0xebd0,0x1599,0x416c,0x4dc5,0x6787,0x9027,0xc193,};static short B[28] = {  /* 0x0000,0x0000,0x0000,0x3ff0, */0xe20a,0x1254,0x5472,0xc053,0x65db,0x0dff,0x7f9e,0x40a5,0x8791,0xf474,0x7695,0xc0ec,0x7a53,0x2bed,0x28da,0x4128,0xaa31,0xb9e8,0x38d1,0xc15a,0xbabd,0x2eb7,0xcd7a,0x4180,0x4dc5,0x6787,0x9027,0xc193,};#endif#if MIEEEstatic short A[28] = {0xc01b,0x53d5,0xaeaa,0x4e7c,0x4072,0x404e,0x0a98,0x409b,0xc0c7,0x5b6b,0x5075,0x1b66,0x4105,0x7f44,0x3452,0x1e82,0xc144,0x031d,0x381b,0xfbed,0x416c,0x1599,0xebd0,0x5013,0xc193,0x9027,0x6787,0x4dc5,};static short B[28] = {  /* 0x3ff0,0x0000,0x0000,0x0000, */0xc053,0x5472,0x1254,0xe20a,0x40a5,0x7f9e,0x0dff,0x65db,0xc0ec,0x7695,0xf474,0x8791,0x4128,0x28da,0x2bed,0x7a53,0xc15a,0x38d1,0xb9e8,0xaa31,0x4180,0xcd7a,0x2eb7,0xbabd,0xc193,0x9027,0x6787,0x4dc5,};#endif#endif /* 0 */#if 0/* 0 < x <= 8   Ei(x) - EUL - ln(x) = x A(x)/B(x)   Theoretical peak relative error 2.14e-17  */#if UNKstatic double A[9] = {-1.111230942210860450145E1, 3.688203982071386319616E2,-4.924786153494029574350E4, 1.050677503345557903241E6,-3.626713709916703688968E7, 4.353499908839918635414E8,-6.454613717232006895409E9, 3.408243056457762907071E10,-1.995466674647028468613E11,};static double B[9] = {  /*  1.000000000000000000000E0, */-1.356757648138514017969E2, 8.562181317107341736606E3,-3.298257180413775117555E5, 8.543534058481435917210E6,-1.542380618535140055068E8, 1.939251779195993632028E9,-1.636096210465615015435E10, 8.396909743075306970605E10,-1.995466674647028425886E11,};#endif#if DECstatic short A[36] = {0141061,0146004,0173357,0151553,0042270,0064402,0147366,0126701,0144100,0057734,0106615,0144356,0045200,0040654,0003332,0004456,0146412,0054440,0043130,0140263,0047317,0113517,0033422,0065123,0150300,0056313,0065235,0131147,0050775,0167423,0146222,0075760,0151471,0153642,0003442,0147667,};static short B[36] = {  /* 0040200,0000000,0000000,0000000, */0142007,0126376,0166077,0043600,0043405,0144271,0125461,0014364,0144641,0006066,0175061,0164463,0046002,0056456,0007370,0121657,0147023,0013706,0156647,0177115,0047747,0026504,0103144,0054507,0150563,0146036,0007051,0177135,0051234,0063625,0173266,0003111,0151471,0153642,0003442,0147666,};#endif#if IBMPCstatic short A[36] = {0xfa6d,0x9edd,0x3980,0xc026,0xd5b8,0x59de,0x0d20,0x4077,0xb91e,0x91b1,0x0bfb,0xc0e8,0x4126,0x80db,0x0835,0x4130,0x1816,0x08cb,0x4b24,0xc181,0x4d4a,0xe6e2,0xf2e9,0x41b9,0xb64d,0x6d53,0x0b99,0xc1f8,0x4f7e,0x7992,0xbde2,0x421f,0x59f7,0x40e4,0x3af4,0xc247,};static short B[36] = {  /* 0x0000,0x0000,0x0000,0x3ff0, */0xe8f0,0xdd87,0xf59f,0xc060,0x231e,0x3566,0xb917,0x40c0,0x3d26,0xdf46,0x2186,0xc114,0x1476,0xc1df,0x4ba5,0x4160,0xffca,0xdbb4,0x62f8,0xc1a2,0x8b29,0x90cc,0xe5a8,0x41dc,0x3fcc,0xc1c5,0x7983,0xc20e,0xc0c9,0xbed6,0x8cf2,0x4233,0x59f7,0x40e4,0x3af4,0xc247,};#endif#if MIEEEstatic short A[36] = {0xc026,0x3980,0x9edd,0xfa6d,0x4077,0x0d20,0x59de,0xd5b8,0xc0e8,0x0bfb,0x91b1,0xb91e,0x4130,0x0835,0x80db,0x4126,0xc181,0x4b24,0x08cb,0x1816,0x41b9,0xf2e9,0xe6e2,0x4d4a,0xc1f8,0x0b99,0x6d53,0xb64d,0x421f,0xbde2,0x7992,0x4f7e,0xc247,0x3af4,0x40e4,0x59f7,};static short B[36] = {  /* 0x3ff0,0x0000,0x0000,0x0000, */0xc060,0xf59f,0xdd87,0xe8f0,0x40c0,0xb917,0x3566,0x231e,0xc114,0x2186,0xdf46,0x3d26,0x4160,0x4ba5,0xc1df,0x1476,0xc1a2,0x62f8,0xdbb4,0xffca,0x41dc,0xe5a8,0x90cc,0x8b29,0xc20e,0x7983,0xc1c5,0x3fcc,0x4233,0x8cf2,0xbed6,0xc0c9,0xc247,0x3af4,0x40e4,0x59f7,};#endif#endif /* 0 *//* 8 <= x <= 20   x exp(-x) Ei(x) - 1 = 1/x R(1/x)   Theoretical peak absolute error = 1.07e-17  */#if UNKstatic double A2[10] = {-2.106934601691916512584E0, 1.732733869664688041885E0,-2.423619178935841904839E-1, 2.322724180937565842585E-2, 2.372880440493179832059E-4,-8.343219561192552752335E-5, 1.363408795605250394881E-5,-3.655412321999253963714E-7, 1.464941733975961318456E-8, 6.176407863710360207074E-10,};static double B2[9] = {  /* 1.000000000000000000000E0, */-2.298062239901678075778E-1, 1.105077041474037862347E-1,-1.566542966630792353556E-2, 2.761106850817352773874E-3,-2.089148012284048449115E-4, 1.708528938807675304186E-5,-4.459311796356686423199E-7, 1.394634930353847498145E-8, 6.150865933977338354138E-10,};#endif#if DECstatic short A2[40] = {0140406,0154004,0035104,0173336,0040335,0145071,0031560,0150165,0137570,0026670,0176230,0055040,0036676,0043416,0077122,0054476,0035170,0150206,0034407,0175571,0134656,0174121,0123231,0021751,0034144,0136766,0036746,0121115,0132704,0037632,0135077,0107300,0031573,0126321,0117076,0004314,0030451,0143233,0041352,0172464,};static short B2[36] = {  /* 0040200,0000000,0000000,0000000, */0137553,0051122,0120721,0170437,0037342,0050734,0175047,0032132,0136600,0052311,0101406,0147050,0036064,0171657,0120001,0071165,0135133,0010043,0151244,0066340,0034217,0051141,0026115,0043305,0132757,0064120,0106341,0051217,0031557,0114261,0060663,0135017,0030451,0011337,0001344,0175542,};#endif#if IBMPCstatic short A2[40] = {0x9edc,0x8748,0xdb00,0xc000,0x1a0f,0x266e,0xb947,0x3ffb,0x0b44,0x1f93,0x05b7,0xbfcf,0x4b28,0xcfca,0xc8e1,0x3f97,0xff6f,0xc720,0x1a10,0x3f2f,0x247d,0x34d3,0xdf0a,0xbf15,0xd44a,0xc7bc,0x97be,0x3eec,0xf1d8,0x5747,0x87f3,0xbe98,0xc119,0x33c7,0x759a,0x3e4f,0x5ea6,0x685d,0x38d3,0x3e05,};static short B2[36] = {  /* 0x0000,0x0000,0x0000,0x3ff0, */0x3e24,0x543a,0x6a4a,0xbfcd,0xe68b,0x9f44,0x4a3b,0x3fbc,0xd9c5,0x3060,0x0a99,0xbf90,0x2e4f,0xf400,0x9e75,0x3f66,0x8d9c,0x7a54,0x6204,0xbf2b,0xa8d9,0x2589,0xea4c,0x3ef1,0x2a52,0x119c,0xed0a,0xbe9d,0x7742,0x2c36,0xf316,0x3e4d,0x9f6c,0xe05c,0x225b,0x3e05,};#endif#if MIEEEstatic short A2[40] = {0xc000,0xdb00,0x8748,0x9edc,0x3ffb,0xb947,0x266e,0x1a0f,0xbfcf,0x05b7,0x1f93,0x0b44,0x3f97,0xc8e1,0xcfca,0x4b28,0x3f2f,0x1a10,0xc720,0xff6f,0xbf15,0xdf0a,0x34d3,0x247d,0x3eec,0x97be,0xc7bc,0xd44a,0xbe98,0x87f3,0x5747,0xf1d8,0x3e4f,0x759a,0x33c7,0xc119,0x3e05,0x38d3,0x685d,0x5ea6,};static short B2[36] = {  /* 0x3ff0,0x0000,0x0000,0x0000, */0xbfcd,0x6a4a,0x543a,0x3e24,0x3fbc,0x4a3b,0x9f44,0xe68b,0xbf90,0x0a99,0x3060,0xd9c5,0x3f66,0x9e75,0xf400,0x2e4f,0xbf2b,0x6204,0x7a54,0x8d9c,0x3ef1,0xea4c,0x2589,0xa8d9,0xbe9d,0xed0a,0x119c,0x2a52,0x3e4d,0xf316,0x2c36,0x7742,0x3e05,0x225b,0xe05c,0x9f6c,};#endif/* x > 20   x exp(-x) Ei(x) - 1  =  1/x A3(1/x)/B3(1/x)   Theoretical absolute error = 6.15e-17  */#if UNKstatic double A3[9] = {-7.657847078286127362028E-1, 6.886192415566705051750E-1,-2.132598113545206124553E-1, 3.346107552384193813594E-2,-3.076541477344756050249E-3, 1.747119316454907477380E-4,-6.103711682274170530369E-6, 1.218032765428652199087E-7,-1.086076102793290233007E-9,};static double B3[9] = {  /* 1.000000000000000000000E0, */-1.888802868662308731041E0, 1.066691687211408896850E0,-2.751915982306380647738E-1, 3.930852688233823569726E-2,-3.414684558602365085394E-3, 1.866844370703555398195E-4,-6.345146083130515357861E-6, 1.239754287483206878024E-7,-1.086076102793126632978E-9,};#endif#if DECstatic short A3[36] = {0140104,0005167,0071746,0115510,0040060,0044531,0140741,0154556,0137532,0060307,0126506,0071123,0037011,0007173,0010405,0127224,0136111,0117715,0003654,0175577,0035067,0031340,0102657,0147714,0133714,0147173,0167473,0136640,0032402,0144407,0115547,0060114,0130625,0042347,0156431,0113425,};static short B3[36] = {  /* 0040200,0000000,0000000,0000000, */0140361,0142112,0155277,0067714,0040210,0104532,0065676,0074326,0137614,0162751,0142421,0131033,0037041,0000772,0053236,0002632,0136137,0144346,0100536,0153136,0035103,0140270,0152211,0166215,0133724,0164143,0145763,0021153,0032405,0017033,0035333,0025736,0130625,0042347,0156431,0077134,};#endif#if IBMPCstatic short A3[36] = {0xd369,0xee7c,0x814e,0xbfe8,0x3b2e,0x383c,0x092b,0x3fe6,0xce4a,0xf5a8,0x4c18,0xbfcb,0xb5d2,0x6220,0x21cf,0x3fa1,0x9f70,0xa0f5,0x33f9,0xbf69,0xf9f9,0x10b5,0xe65c,0x3f26,0x77b4,0x7de7,0x99cf,0xbed9,0xec09,0xf36c,0x5920,0x3e80,0x32e3,0xfba3,0xa89c,0xbe12,};static short B3[36] = {  /* 0x0000,0x0000,0x0000,0x3ff0, */0xedf9,0x5b57,0x3889,0xbffe,0xcf1b,0x4d77,0x112b,0x3ff1,0x3643,0x38a2,0x9cbd,0xbfd1,0xc0b3,0x4ad3,0x203f,0x3fa4,0xdacc,0xd02b,0xf91c,0xbf6b,0x3d92,0x1a91,0x7817,0x3f28,0x644d,0x797e,0x9d0c,0xbeda,0x657c,0x675b,0xa3c3,0x3e80,0x2fcb,0xfba3,0xa89c,0xbe12,};#endif#if MIEEEstatic short A3[36] = {0xbfe8,0x814e,0xee7c,0xd369,0x3fe6,0x092b,0x383c,0x3b2e,0xbfcb,0x4c18,0xf5a8,0xce4a,0x3fa1,0x21cf,0x6220,0xb5d2,0xbf69,0x33f9,0xa0f5,0x9f70,0x3f26,0xe65c,0x10b5,0xf9f9,0xbed9,0x99cf,0x7de7,0x77b4,0x3e80,0x5920,0xf36c,0xec09,0xbe12,0xa89c,0xfba3,0x32e3,};static short B3[36] = {/* 0x3ff0,0x0000,0x0000,0x0000, */0xbffe,0x3889,0x5b57,0xedf9,0x3ff1,0x112b,0x4d77,0xcf1b,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -