/* sici.c
*
* Sine and cosine integrals
*
*
*
* SYNOPSIS :
*
* double x , Ci , Si , sici ( ) ;
*
* sici ( x , & Si , & Ci ) ;
*
*
* DESCRIPTION :
*
* Evaluates the integrals
*
* x
* -
* | cos t - 1
* Ci ( x ) = eul + ln x + | - - - - - - - - - dt ,
* | t
* -
* 0
* x
* -
* | sin t
* Si ( x ) = | - - - - - dt
* | t
* -
* 0
*
* where eul = 0 . 57721566490153286061 is Euler ' s constant .
* The integrals are approximated by rational functions .
* For x > 8 auxiliary functions f ( x ) and g ( x ) are employed
* such that
*
* Ci ( x ) = f ( x ) sin ( x ) - g ( x ) cos ( x )
* Si ( x ) = pi / 2 - f ( x ) cos ( x ) - g ( x ) sin ( x )
*
*
* ACCURACY :
* Test interval = [ 0 , 50 ] .
* Absolute error , except relative when > 1 :
* arithmetic function # trials peak rms
* IEEE Si 30000 4 . 4 e - 16 7 . 3 e - 17
* IEEE Ci 30000 6 . 9 e - 16 5 . 1 e - 17
* DEC Si 5000 4 . 4 e - 17 9 . 0 e - 18
* DEC Ci 5300 7 . 9 e - 17 5 . 2 e - 18
*/
/*
Cephes Math Library Release 2 . 1 : January , 1989
Copyright 1984 , 1987 , 1989 by Stephen L . Moshier
Direct inquiries to 30 Frost Street , Cambridge , MA 02140
*/
#include "mconf.h"
#ifdef UNK
static double SN[] = {
-8 .39167827910303881427 E-11 ,
4 .62591714427012837309 E-8 ,
-9 .75759303843632795789 E-6 ,
9 .76945438170435310816 E-4 ,
-4 .13470316229406538752 E-2 ,
1 .00000000000000000302 E0,
};
static double SD[] = {
2 .03269266195951942049 E-12 ,
1 .27997891179943299903 E-9 ,
4 .41827842801218905784 E-7 ,
9 .96412122043875552487 E-5 ,
1 .42085239326149893930 E-2 ,
9 .99999999999999996984 E-1 ,
};
#endif
#ifdef DEC
static unsigned short SN[] = {
0127670 ,0104362 ,0167505 ,0035161 ,
0032106 ,0127177 ,0032131 ,0056461 ,
0134043 ,0132213 ,0000476 ,0172351 ,
0035600 ,0006331 ,0064761 ,0032665 ,
0137051 ,0055601 ,0044667 ,0017645 ,
0040200 ,0000000 ,0000000 ,0000000 ,
};
static unsigned short SD[] = {
0026417 ,0004674 ,0052064 ,0001573 ,
0030657 ,0165501 ,0014666 ,0131526 ,
0032755 ,0032133 ,0034147 ,0024124 ,
0034720 ,0173167 ,0166624 ,0154477 ,
0036550 ,0145336 ,0063534 ,0063220 ,
0040200 ,0000000 ,0000000 ,0000000 ,
};
#endif
#ifdef IBMPC
static unsigned short SN[] = {
0 xa74e,0 x5de8,0 x111e,0 xbdd7,
0 x2ba6,0 xe68b,0 xd5cf,0 x3e68,
0 xde9d,0 x6027,0 x7691,0 xbee4,
0 x26b7,0 x2d3e,0 x019b,0 x3f50,
0 xe3f5,0 x2936,0 x2b70,0 xbfa5,
0 x0000,0 x0000,0 x0000,0 x3ff0,
};
static unsigned short SD[] = {
0 x806f,0 x8a86,0 xe137,0 x3d81,
0 xd66b,0 x2336,0 xfd68,0 x3e15,
0 xe50a,0 x670c,0 xa68b,0 x3e9d,
0 x9b28,0 xfdb2,0 x1ece,0 x3f1a,
0 x8cd2,0 xcceb,0 x195b,0 x3f8d,
0 x0000,0 x0000,0 x0000,0 x3ff0,
};
#endif
#ifdef MIEEE
static unsigned short SN[] = {
0 xbdd7,0 x111e,0 x5de8,0 xa74e,
0 x3e68,0 xd5cf,0 xe68b,0 x2ba6,
0 xbee4,0 x7691,0 x6027,0 xde9d,
0 x3f50,0 x019b,0 x2d3e,0 x26b7,
0 xbfa5,0 x2b70,0 x2936,0 xe3f5,
0 x3ff0,0 x0000,0 x0000,0 x0000,
};
static unsigned short SD[] = {
0 x3d81,0 xe137,0 x8a86,0 x806f,
0 x3e15,0 xfd68,0 x2336,0 xd66b,
0 x3e9d,0 xa68b,0 x670c,0 xe50a,
0 x3f1a,0 x1ece,0 xfdb2,0 x9b28,
0 x3f8d,0 x195b,0 xcceb,0 x8cd2,
0 x3ff0,0 x0000,0 x0000,0 x0000,
};
#endif
#ifdef UNK
static double CN[] = {
2 .02524002389102268789 E-11 ,
-1 .35249504915790756375 E-8 ,
3 .59325051419993077021 E-6 ,
-4 .74007206873407909465 E-4 ,
2 .89159652607555242092 E-2 ,
-1 .00000000000000000080 E0,
};
static double CD[] = {
4 .07746040061880559506 E-12 ,
3 .06780997581887812692 E-9 ,
1 .23210355685883423679 E-6 ,
3 .17442024775032769882 E-4 ,
5 .10028056236446052392 E-2 ,
4 .00000000000000000080 E0,
};
#endif
#ifdef DEC
static unsigned short CN[] = {
0027262 ,0022131 ,0160257 ,0020166 ,
0131550 ,0055534 ,0077637 ,0000557 ,
0033561 ,0021622 ,0161463 ,0026575 ,
0135370 ,0102053 ,0116333 ,0000466 ,
0036754 ,0160454 ,0122022 ,0024622 ,
0140200 ,0000000 ,0000000 ,0000000 ,
};
static unsigned short CD[] = {
0026617 ,0073177 ,0107543 ,0104425 ,
0031122 ,0150573 ,0156453 ,0041517 ,
0033245 ,0057301 ,0077706 ,0110510 ,
0035246 ,0067130 ,0165424 ,0044543 ,
0037120 ,0164121 ,0061206 ,0053657 ,
0040600 ,0000000 ,0000000 ,0000000 ,
};
#endif
#ifdef IBMPC
static unsigned short CN[] = {
0 xe40f,0 x3c15,0 x448b,0 x3db6,
0 xe02e,0 x8ff3,0 x0b6b,0 xbe4d,
0 x65b0,0 x5c66,0 x2472,0 x3ece,
0 x6027,0 x739b,0 x1085,0 xbf3f,
0 x4532,0 x9482,0 x9c25,0 x3f9d,
0 x0000,0 x0000,0 x0000,0 xbff0,
};
static unsigned short CD[] = {
0 x7123,0 xf1ec,0 xeecf,0 x3d91,
0 x686a,0 x7ba5,0 x5a2f,0 x3e2a,
0 xd229,0 x2ff8,0 xabd8,0 x3eb4,
0 x892c,0 x1d62,0 xcdcb,0 x3f34,
0 xcaf6,0 x2c50,0 x1d0a,0 x3faa,
0 x0000,0 x0000,0 x0000,0 x4010,
};
#endif
#ifdef MIEEE
static unsigned short CN[] = {
0 x3db6,0 x448b,0 x3c15,0 xe40f,
0 xbe4d,0 x0b6b,0 x8ff3,0 xe02e,
0 x3ece,0 x2472,0 x5c66,0 x65b0,
0 xbf3f,0 x1085,0 x739b,0 x6027,
0 x3f9d,0 x9c25,0 x9482,0 x4532,
0 xbff0,0 x0000,0 x0000,0 x0000,
};
static unsigned short CD[] = {
0 x3d91,0 xeecf,0 xf1ec,0 x7123,
0 x3e2a,0 x5a2f,0 x7ba5,0 x686a,
0 x3eb4,0 xabd8,0 x2ff8,0 xd229,
0 x3f34,0 xcdcb,0 x1d62,0 x892c,
0 x3faa,0 x1d0a,0 x2c50,0 xcaf6,
0 x4010,0 x0000,0 x0000,0 x0000,
};
#endif
#ifdef UNK
static double FN4[] = {
4 .23612862892216586994 E0,
5 .45937717161812843388 E0,
1 .62083287701538329132 E0,
1 .67006611831323023771 E-1 ,
6 .81020132472518137426 E-3 ,
1 .08936580650328664411 E-4 ,
5 .48900223421373614008 E-7 ,
};
static double FD4[] = {
/* 1.00000000000000000000E0,*/
8 .16496634205391016773 E0,
7 .30828822505564552187 E0,
1 .86792257950184183883 E0,
1 .78792052963149907262 E-1 ,
7 .01710668322789753610 E-3 ,
1 .10034357153915731354 E-4 ,
5 .48900252756255700982 E-7 ,
};
#endif
#ifdef DEC
static unsigned short FN4[] = {
0040607 ,0107135 ,0120133 ,0153471 ,
0040656 ,0131467 ,0140424 ,0017567 ,
0040317 ,0073563 ,0121610 ,0002511 ,
0037453 ,0001710 ,0000040 ,0006334 ,
0036337 ,0024033 ,0176003 ,0171425 ,
0034744 ,0072341 ,0121657 ,0126035 ,
0033023 ,0054042 ,0154652 ,0000451 ,
};
static unsigned short FD4[] = {
/*0040200,0000000,0000000,0000000,*/
0041002 ,0121663 ,0137500 ,0177450 ,
0040751 ,0156577 ,0042213 ,0061552 ,
0040357 ,0014026 ,0045465 ,0147265 ,
0037467 ,0012503 ,0110413 ,0131772 ,
0036345 ,0167701 ,0155706 ,0160551 ,
0034746 ,0141076 ,0162250 ,0123547 ,
0033023 ,0054043 ,0056706 ,0151050 ,
};
#endif
#ifdef IBMPC
static unsigned short FN4[] = {
0 x7ae7,0 xb40b,0 xf1cb,0 x4010,
0 x83ef,0 xf822,0 xd666,0 x4015,
0 x00a9,0 x7471,0 xeeee,0 x3ff9,
0 x019c,0 x0004,0 x6079,0 x3fc5,
0 x7e63,0 x7f80,0 xe503,0 x3f7b,
0 xf584,0 x3475,0 x8e9c,0 x3f1c,
0 x4025,0 x5b35,0 x6b04,0 x3ea2,
};
static unsigned short FD4[] = {
/*0x0000,0x0000,0x0000,0x3ff0,*/
0 x1fe5,0 x77e8,0 x5476,0 x4020,
0 x6c6d,0 xe891,0 x3baf,0 x401d,
0 xb9d7,0 xc966,0 xe302,0 x3ffd,
0 x767f,0 x7221,0 xe2a8,0 x3fc6,
0 xdc2d,0 x3b78,0 xbdf8,0 x3f7c,
0 x14ed,0 xdc95,0 xd847,0 x3f1c,
0 xda45,0 x6bb8,0 x6b04,0 x3ea2,
};
#endif
#ifdef MIEEE
static unsigned short FN4[] = {
0 x4010,0 xf1cb,0 xb40b,0 x7ae7,
0 x4015,0 xd666,0 xf822,0 x83ef,
0 x3ff9,0 xeeee,0 x7471,0 x00a9,
0 x3fc5,0 x6079,0 x0004,0 x019c,
0 x3f7b,0 xe503,0 x7f80,0 x7e63,
0 x3f1c,0 x8e9c,0 x3475,0 xf584,
0 x3ea2,0 x6b04,0 x5b35,0 x4025,
};
static unsigned short FD4[] = {
/* 0x3ff0,0x0000,0x0000,0x0000,*/
0 x4020,0 x5476,0 x77e8,0 x1fe5,
0 x401d,0 x3baf,0 xe891,0 x6c6d,
0 x3ffd,0 xe302,0 xc966,0 xb9d7,
0 x3fc6,0 xe2a8,0 x7221,0 x767f,
0 x3f7c,0 xbdf8,0 x3b78,0 xdc2d,
0 x3f1c,0 xd847,0 xdc95,0 x14ed,
0 x3ea2,0 x6b04,0 x6bb8,0 xda45,
};
#endif
#ifdef UNK
static double FN8[] = {
4 .55880873470465315206 E-1 ,
7 .13715274100146711374 E-1 ,
1 .60300158222319456320 E-1 ,
1 .16064229408124407915 E-2 ,
3 .49556442447859055605 E-4 ,
4 .86215430826454749482 E-6 ,
3 .20092790091004902806 E-8 ,
9 .41779576128512936592 E-11 ,
9 .70507110881952024631 E-14 ,
};
static double FD8[] = {
/* 1.00000000000000000000E0,*/
9 .17463611873684053703 E-1 ,
1 .78685545332074536321 E-1 ,
1 .22253594771971293032 E-2 ,
3 .58696481881851580297 E-4 ,
4 .92435064317881464393 E-6 ,
3 .21956939101046018377 E-8 ,
9 .43720590350276732376 E-11 ,
9 .70507110881952025725 E-14 ,
};
#endif
#ifdef DEC
static unsigned short FN8[] = {
0037751 ,0064467 ,0142332 ,0164573 ,
0040066 ,0133013 ,0050352 ,0071102 ,
0037444 ,0022671 ,0102157 ,0013535 ,
0036476 ,0024335 ,0136423 ,0146444 ,
0035267 ,0042253 ,0164110 ,0110460 ,
0033643 ,0022626 ,0062535 ,0060320 ,
0032011 ,0075223 ,0010110 ,0153413 ,
0027717 ,0014572 ,0011360 ,0014034 ,
0025332 ,0104755 ,0004563 ,0152354 ,
};
static unsigned short FD8[] = {
/*0040200,0000000,0000000,0000000,*/
0040152 ,0157345 ,0030104 ,0075616 ,
0037466 ,0174527 ,0172740 ,0071060 ,
0036510 ,0046337 ,0144272 ,0156552 ,
0035274 ,0007555 ,0042537 ,0015572 ,
0033645 ,0035731 ,0112465 ,0026474 ,
0032012 ,0043612 ,0030613 ,0030123 ,
0027717 ,0103277 ,0004564 ,0151000 ,
0025332 ,0104755 ,0004563 ,0152354 ,
};
#endif
#ifdef IBMPC
static unsigned short FN8[] = {
0 x5d2f,0 xf89b,0 x2d26,0 x3fdd,
0 x4e48,0 x6a1d,0 xd6c1,0 x3fe6,
0 xe2ec,0 x308d,0 x84b7,0 x3fc4,
0 x79a4,0 xb7a2,0 xc51b,0 x3f87,
0 x1226,0 x7d09,0 xe895,0 x3f36,
0 xac1a,0 xccab,0 x64b2,0 x3ed4,
0 x1ae1,0 x6209,0 x2f52,0 x3e61,
0 x0304,0 x425e,0 xe32f,0 x3dd9,
0 x7a9d,0 xa12e,0 x513d,0 x3d3b,
};
static unsigned short FD8[] = {
/*0x0000,0x0000,0x0000,0x3ff0,*/
0 x8f72,0 xa608,0 x5bdc,0 x3fed,
0 x0e46,0 xfebc,0 xdf2a,0 x3fc6,
0 x5bad,0 xf917,0 x099b,0 x3f89,
0 xe36f,0 xa8ab,0 x81ed,0 x3f37,
0 xa5a8,0 x32a6,0 xa77b,0 x3ed4,
0 x660a,0 x4631,0 x48f1,0 x3e61,
0 x9a40,0 xe12e,0 xf0d7,0 x3dd9,
0 x7a9d,0 xa12e,0 x513d,0 x3d3b,
};
#endif
#ifdef MIEEE
static unsigned short FN8[] = {
0 x3fdd,0 x2d26,0 xf89b,0 x5d2f,
0 x3fe6,0 xd6c1,0 x6a1d,0 x4e48,
0 x3fc4,0 x84b7,0 x308d,0 xe2ec,
0 x3f87,0 xc51b,0 xb7a2,0 x79a4,
0 x3f36,0 xe895,0 x7d09,0 x1226,
0 x3ed4,0 x64b2,0 xccab,0 xac1a,
0 x3e61,0 x2f52,0 x6209,0 x1ae1,
0 x3dd9,0 xe32f,0 x425e,0 x0304,
0 x3d3b,0 x513d,0 xa12e,0 x7a9d,
};
static unsigned short FD8[] = {
/*0x3ff0,0x0000,0x0000,0x0000,*/
0 x3fed,0 x5bdc,0 xa608,0 x8f72,
0 x3fc6,0 xdf2a,0 xfebc,0 x0e46,
0 x3f89,0 x099b,0 xf917,0 x5bad,
0 x3f37,0 x81ed,0 xa8ab,0 xe36f,
0 x3ed4,0 xa77b,0 x32a6,0 xa5a8,
0 x3e61,0 x48f1,0 x4631,0 x660a,
0 x3dd9,0 xf0d7,0 xe12e,0 x9a40,
0 x3d3b,0 x513d,0 xa12e,0 x7a9d,
};
#endif
#ifdef UNK
static double GN4[] = {
8 .71001698973114191777 E-2 ,
6 .11379109952219284151 E-1 ,
3 .97180296392337498885 E-1 ,
7 .48527737628469092119 E-2 ,
5 .38868681462177273157 E-3 ,
1 .61999794598934024525 E-4 ,
1 .97963874140963632189 E-6 ,
7 .82579040744090311069 E-9 ,
};
static double GD4[] = {
/* 1.00000000000000000000E0,*/
1 .64402202413355338886 E0,
6 .66296701268987968381 E-1 ,
9 .88771761277688796203 E-2 ,
6 .22396345441768420760 E-3 ,
1 .73221081474177119497 E-4 ,
2 .02659182086343991969 E-6 ,
7 .82579218933534490868 E-9 ,
};
#endif
#ifdef DEC
static unsigned short GN4[] = {
0037262 ,0060622 ,0164572 ,0157515 ,
0040034 ,0101527 ,0061263 ,0147204 ,
0037713 ,0055467 ,0037475 ,0144512 ,
0037231 ,0046151 ,0035234 ,0045261 ,
0036260 ,0111624 ,0150617 ,0053536 ,
0035051 ,0157175 ,0016675 ,0155456 ,
0033404 ,0154757 ,0041211 ,0000055 ,
0031406 ,0071060 ,0130322 ,0033322 ,
};
static unsigned short GD4[] = {
/* 0040200,0000000,0000000,0000000,*/
0040322 ,0067520 ,0046707 ,0053275 ,
0040052 ,0111153 ,0126542 ,0005516 ,
0037312 ,0100035 ,0167121 ,0014552 ,
0036313 ,0171143 ,0137176 ,0014213 ,
0035065 ,0121256 ,0012033 ,0150603 ,
0033410 ,0000225 ,0013121 ,0071643 ,
0031406 ,0071062 ,0131152 ,0150454 ,
};
#endif
#ifdef IBMPC
static unsigned short GN4[] = {
0 x5bea,0 x5d2f,0 x4c32,0 x3fb6,
0 x79d1,0 xec56,0 x906a,0 x3fe3,
0 xb929,0 xe7e7,0 x6b66,0 x3fd9,
0 x8956,0 x2753,0 x298d,0 x3fb3,
0 xeaec,0 x9a31,0 x1272,0 x3f76,
0 xbb66,0 xa3b7,0 x3bcf,0 x3f25,
0 x2006,0 xe851,0 x9b3d,0 x3ec0,
0 x46da,0 x161a,0 xce46,0 x3e40,
};
static unsigned short GD4[] = {
/* 0x0000,0x0000,0x0000,0x3ff0,*/
0 xead8,0 x09b8,0 x4dea,0 x3ffa,
0 x416a,0 x75ac,0 x524d,0 x3fe5,
0 x232d,0 xbdca,0 x5003,0 x3fb9,
0 xc311,0 x77cf,0 x7e4c,0 x3f79,
0 x7a30,0 xc283,0 xb455,0 x3f26,
0 x2e74,0 xa2ca,0 x0012,0 x3ec1,
0 x5a26,0 x564d,0 xce46,0 x3e40,
};
#endif
#ifdef MIEEE
static unsigned short GN4[] = {
0 x3fb6,0 x4c32,0 x5d2f,0 x5bea,
0 x3fe3,0 x906a,0 xec56,0 x79d1,
0 x3fd9,0 x6b66,0 xe7e7,0 xb929,
0 x3fb3,0 x298d,0 x2753,0 x8956,
0 x3f76,0 x1272,0 x9a31,0 xeaec,
0 x3f25,0 x3bcf,0 xa3b7,0 xbb66,
0 x3ec0,0 x9b3d,0 xe851,0 x2006,
0 x3e40,0 xce46,0 x161a,0 x46da,
};
static unsigned short GD4[] = {
/*0x3ff0,0x0000,0x0000,0x0000,*/
0 x3ffa,0 x4dea,0 x09b8,0 xead8,
0 x3fe5,0 x524d,0 x75ac,0 x416a,
0 x3fb9,0 x5003,0 xbdca,0 x232d,
0 x3f79,0 x7e4c,0 x77cf,0 xc311,
0 x3f26,0 xb455,0 xc283,0 x7a30,
0 x3ec1,0 x0012,0 xa2ca,0 x2e74,
0 x3e40,0 xce46,0 x564d,0 x5a26,
};
#endif
#ifdef UNK
static double GN8[] = {
6 .97359953443276214934 E-1 ,
3 .30410979305632063225 E-1 ,
3 .84878767649974295920 E-2 ,
1 .71718239052347903558 E-3 ,
3 .48941165502279436777 E-5 ,
3 .47131167084116673800 E-7 ,
1 .70404452782044526189 E-9 ,
3 .85945925430276600453 E-12 ,
3 .14040098946363334640 E-15 ,
};
static double GD8[] = {
/* 1.00000000000000000000E0,*/
1 .68548898811011640017 E0,
4 .87852258695304967486 E-1 ,
4 .67913194259625806320 E-2 ,
1 .90284426674399523638 E-3 ,
3 .68475504442561108162 E-5 ,
3 .57043223443740838771 E-7 ,
1 .72693748966316146736 E-9 ,
3 .87830166023954706752 E-12 ,
3 .14040098946363335242 E-15 ,
};
#endif
#ifdef DEC
static unsigned short GN8[] = {
0040062 ,0103056 ,0110624 ,0033123 ,
0037651 ,0025640 ,0136266 ,0145647 ,
0037035 ,0122566 ,0137770 ,0061777 ,
0035741 ,0011424 ,0065311 ,0013370 ,
0034422 ,0055505 ,0134324 ,0016755 ,
0032672 ,0056530 ,0022565 ,0014747 ,
0030752 ,0031674 ,0114735 ,0013162 ,
0026607 ,0145353 ,0022020 ,0123625 ,
0024142 ,0045054 ,0060033 ,0016505 ,
};
static unsigned short GD8[] = {
/*0040200,0000000,0000000,0000000,*/
0040327 ,0137032 ,0064331 ,0136425 ,
0037771 ,0143705 ,0070300 ,0105711 ,
0037077 ,0124101 ,0025275 ,0035356 ,
0035771 ,0064333 ,0145103 ,0105357 ,
0034432 ,0106301 ,0105311 ,0010713 ,
0032677 ,0127645 ,0120034 ,0157551 ,
0030755 ,0054466 ,0010743 ,0105566 ,
0026610 ,0072242 ,0142530 ,0135744 ,
0024142 ,0045054 ,0060033 ,0016505 ,
};
#endif
#ifdef IBMPC
static unsigned short GN8[] = {
0 x86ca,0 xd232,0 x50c5,0 x3fe6,
0 xd975,0 x1796,0 x2574,0 x3fd5,
0 x0c80,0 xd7ff,0 xb4ae,0 x3fa3,
0 x22df,0 x8d59,0 x2262,0 x3f5c,
0 x83be,0 xb71a,0 x4b68,0 x3f02,
0 xa33d,0 x04ae,0 x4bab,0 x3e97,
0 xa2ce,0 x933b,0 x4677,0 x3e1d,
0 x14f3,0 x6482,0 xf95d,0 x3d90,
0 x63a9,0 x8c03,0 x4945,0 x3cec,
};
static unsigned short GD8[] = {
/*0x0000,0x0000,0x0000,0x3ff0,*/
0 x37a3,0 x4d1b,0 xf7c3,0 x3ffa,
0 x1179,0 xae18,0 x38f8,0 x3fdf,
0 xa75e,0 x2557,0 xf508,0 x3fa7,
0 x715e,0 x7948,0 x2d1b,0 x3f5f,
0 x2239,0 x3159,0 x5198,0 x3f03,
0 x9bed,0 xb403,0 xf5f4,0 x3e97,
0 x716f,0 xc23c,0 xab26,0 x3e1d,
0 x177c,0 x58ab,0 x0e94,0 x3d91,
0 x63a9,0 x8c03,0 x4945,0 x3cec,
};
#endif
#ifdef MIEEE
static unsigned short GN8[] = {
0 x3fe6,0 x50c5,0 xd232,0 x86ca,
0 x3fd5,0 x2574,0 x1796,0 xd975,
0 x3fa3,0 xb4ae,0 xd7ff,0 x0c80,
0 x3f5c,0 x2262,0 x8d59,0 x22df,
0 x3f02,0 x4b68,0 xb71a,0 x83be,
0 x3e97,0 x4bab,0 x04ae,0 xa33d,
0 x3e1d,0 x4677,0 x933b,0 xa2ce,
0 x3d90,0 xf95d,0 x6482,0 x14f3,
0 x3cec,0 x4945,0 x8c03,0 x63a9,
};
static unsigned short GD8[] = {
/*0x3ff0,0x0000,0x0000,0x0000,*/
0 x3ffa,0 xf7c3,0 x4d1b,0 x37a3,
0 x3fdf,0 x38f8,0 xae18,0 x1179,
0 x3fa7,0 xf508,0 x2557,0 xa75e,
0 x3f5f,0 x2d1b,0 x7948,0 x715e,
0 x3f03,0 x5198,0 x3159,0 x2239,
0 x3e97,0 xf5f4,0 xb403,0 x9bed,
0 x3e1d,0 xab26,0 xc23c,0 x716f,
0 x3d91,0 x0e94,0 x58ab,0 x177c,
0 x3cec,0 x4945,0 x8c03,0 x63a9,
};
#endif
#ifdef ANSIPROT
extern double log ( double );
extern double sin ( double );
extern double cos ( double );
extern double polevl ( double , void *, int );
extern double p1evl ( double , void *, int );
#else
double log(), sin(), cos(), polevl(), p1evl();
#endif
#define EUL 0 .57721566490153286061
extern double MAXNUM, PIO2, MACHEP;
int sici( x, si, ci )
double x;
double *si, *ci;
{
double z, c, s, f, g;
short sign;
if ( x < 0 .0 )
{
sign = -1 ;
x = -x;
}
else
sign = 0 ;
if ( x == 0 .0 )
{
*si = 0 .0 ;
*ci = -MAXNUM;
return ( 0 );
}
if ( x > 1 .0 e9 )
{
*si = PIO2 - cos(x)/x;
*ci = sin(x)/x;
return ( 0 );
}
if ( x > 4 .0 )
goto asympt;
z = x * x;
s = x * polevl( z, SN, 5 ) / polevl( z, SD, 5 );
c = z * polevl( z, CN, 5 ) / polevl( z, CD, 5 );
if ( sign )
s = -s;
*si = s;
*ci = EUL + log(x) + c; /* real part if x < 0 */
return (0 );
/* The auxiliary functions are:
*
*
* * si = * si - PIO2 ;
* c = cos ( x ) ;
* s = sin ( x ) ;
*
* t = * ci * s - * si * c ;
* a = * ci * c + * si * s ;
*
* * si = t ;
* * ci = - a ;
*/
asympt:
s = sin(x);
c = cos(x);
z = 1 .0 /(x*x);
if ( x < 8 .0 )
{
f = polevl( z, FN4, 6 ) / (x * p1evl( z, FD4, 7 ));
g = z * polevl( z, GN4, 7 ) / p1evl( z, GD4, 7 );
}
else
{
f = polevl( z, FN8, 8 ) / (x * p1evl( z, FD8, 8 ));
g = z * polevl( z, GN8, 8 ) / p1evl( z, GD8, 9 );
}
*si = PIO2 - f * c - g * s;
if ( sign )
*si = -( *si );
*ci = f * s - g * c;
return (0 );
}
Messung V0.5 in Prozent C=98 H=99 G=98