/* shichi.c
*
* Hyperbolic sine and cosine integrals
*
*
*
* SYNOPSIS :
*
* double x , Chi , Shi , shichi ( ) ;
*
* shichi ( x , & Chi , & Shi ) ;
*
*
* DESCRIPTION :
*
* Approximates the integrals
*
* x
* -
* | | cosh t - 1
* Chi ( x ) = eul + ln x + | - - - - - - - - - - - dt ,
* | | t
* -
* 0
*
* x
* -
* | | sinh t
* Shi ( x ) = | - - - - - - dt
* | | t
* -
* 0
*
* where eul = 0 . 57721566490153286061 is Euler ' s constant .
* The integrals are evaluated by power series for x < 8
* and by Chebyshev expansions for x between 8 and 88 .
* For large x , both functions approach exp ( x ) / 2 x .
* Arguments greater than 88 in magnitude return MAXNUM .
*
*
* ACCURACY :
*
* Test interval 0 to 88 .
* Relative error :
* arithmetic function # trials peak rms
* DEC Shi 3000 9 . 1 e - 17
* IEEE Shi 30000 6 . 9 e - 16 1 . 6 e - 16
* Absolute error , except relative when | Chi | > 1 :
* DEC Chi 2500 9 . 3 e - 17
* IEEE Chi 30000 8 . 4 e - 16 1 . 4 e - 16
*/
/*
Cephes Math Library Release 2 . 8 : June , 2000
Copyright 1984 , 1987 , 2000 by Stephen L . Moshier
*/
#include "mconf.h"
#ifdef UNK
/* x exp(-x) shi(x), inverted interval 8 to 18 */
static double S1[] = {
1 .83889230173399459482 E-17 ,
-9 .55485532279655569575 E-17 ,
2 .04326105980879882648 E-16 ,
1 .09896949074905343022 E-15 ,
-1 .31313534344092599234 E-14 ,
5 .93976226264314278932 E-14 ,
-3 .47197010497749154755 E-14 ,
-1 .40059764613117131000 E-12 ,
9 .49044626224223543299 E-12 ,
-1 .61596181145435454033 E-11 ,
-1 .77899784436430310321 E-10 ,
1 .35455469767246947469 E-9 ,
-1 .03257121792819495123 E-9 ,
-3 .56699611114982536845 E-8 ,
1 .44818877384267342057 E-7 ,
7 .82018215184051295296 E-7 ,
-5 .39919118403805073710 E-6 ,
-3 .12458202168959833422 E-5 ,
8 .90136741950727517826 E-5 ,
2 .02558474743846862168 E-3 ,
2 .96064440855633256972 E-2 ,
1 .11847751047257036625 E0
};
/* x exp(-x) shi(x), inverted interval 18 to 88 */
static double S2[] = {
-1 .05311574154850938805 E-17 ,
2 .62446095596355225821 E-17 ,
8 .82090135625368160657 E-17 ,
-3 .38459811878103047136 E-16 ,
-8 .30608026366935789136 E-16 ,
3 .93397875437050071776 E-15 ,
1 .01765565969729044505 E-14 ,
-4 .21128170307640802703 E-14 ,
-1 .60818204519802480035 E-13 ,
3 .34714954175994481761 E-13 ,
2 .72600352129153073807 E-12 ,
1 .66894954752839083608 E-12 ,
-3 .49278141024730899554 E-11 ,
-1 .58580661666482709598 E-10 ,
-1 .79289437183355633342 E-10 ,
1 .76281629144264523277 E-9 ,
1 .69050228879421288846 E-8 ,
1 .25391771228487041649 E-7 ,
1 .16229947068677338732 E-6 ,
1 .61038260117376323993 E-5 ,
3 .49810375601053973070 E-4 ,
1 .28478065259647610779 E-2 ,
1 .03665722588798326712 E0
};
#endif
#ifdef DEC
static unsigned short S1[] = {
0022251 ,0115635 ,0165120 ,0006574 ,
0122734 ,0050751 ,0020305 ,0101356 ,
0023153 ,0111154 ,0011103 ,0177462 ,
0023636 ,0060321 ,0060253 ,0124246 ,
0124554 ,0106655 ,0152525 ,0166400 ,
0025205 ,0140145 ,0171006 ,0106556 ,
0125034 ,0056427 ,0004205 ,0176022 ,
0126305 ,0016731 ,0025011 ,0134453 ,
0027046 ,0172453 ,0112604 ,0116235 ,
0127216 ,0022071 ,0116600 ,0137667 ,
0130103 ,0115126 ,0071104 ,0052535 ,
0030672 ,0025450 ,0010071 ,0141414 ,
0130615 ,0165136 ,0132137 ,0177737 ,
0132031 ,0031611 ,0074436 ,0175407 ,
0032433 ,0077602 ,0104345 ,0060076 ,
0033121 ,0165741 ,0167177 ,0172433 ,
0133665 ,0025262 ,0174621 ,0022612 ,
0134403 ,0006761 ,0124566 ,0145405 ,
0034672 ,0126332 ,0034737 ,0116744 ,
0036004 ,0137654 ,0037332 ,0131766 ,
0036762 ,0104466 ,0121445 ,0124326 ,
0040217 ,0025105 ,0062145 ,0042640
};
static unsigned short S2[] = {
0122102 ,0041774 ,0016051 ,0055137 ,
0022362 ,0010125 ,0007651 ,0015773 ,
0022713 ,0062551 ,0040227 ,0071645 ,
0123303 ,0015732 ,0025731 ,0146570 ,
0123557 ,0064016 ,0002067 ,0067711 ,
0024215 ,0136214 ,0132374 ,0124234 ,
0024467 ,0051425 ,0071066 ,0064210 ,
0125075 ,0124305 ,0135123 ,0024170 ,
0125465 ,0010261 ,0005560 ,0034232 ,
0025674 ,0066602 ,0030724 ,0174557 ,
0026477 ,0151520 ,0051510 ,0067250 ,
0026352 ,0161076 ,0113154 ,0116271 ,
0127431 ,0116470 ,0177465 ,0127274 ,
0130056 ,0056174 ,0170315 ,0013321 ,
0130105 ,0020575 ,0075327 ,0036710 ,
0030762 ,0043625 ,0113046 ,0125035 ,
0031621 ,0033211 ,0154354 ,0022077 ,
0032406 ,0121555 ,0074270 ,0041141 ,
0033234 ,0000116 ,0041611 ,0173743 ,
0034207 ,0013263 ,0174715 ,0115563 ,
0035267 ,0063300 ,0175753 ,0117266 ,
0036522 ,0077633 ,0033255 ,0136200 ,
0040204 ,0130457 ,0014454 ,0166254
};
#endif
#ifdef IBMPC
static unsigned short S1[] = {
0 x01b0,0 xbd4a,0 x3373,0 x3c75,
0 xb05e,0 x2418,0 x8a3d,0 xbc9b,
0 x7fe6,0 x8248,0 x724d,0 x3cad,
0 x7515,0 x2c15,0 xcc1a,0 x3cd3,
0 xbda0,0 xbaaa,0 x91b5,0 xbd0d,
0 xd1ae,0 xbe40,0 xb80c,0 x3d30,
0 xbf82,0 xe110,0 x8ba2,0 xbd23,
0 x3725,0 x2541,0 xa3bb,0 xbd78,
0 x9394,0 x72b0,0 xdea5,0 x3da4,
0 x17f7,0 x33b0,0 xc487,0 xbdb1,
0 x8aac,0 xce48,0 x734a,0 xbde8,
0 x3862,0 x0207,0 x4565,0 x3e17,
0 xfffc,0 xd68b,0 xbd4b,0 xbe11,
0 xdf61,0 x2f23,0 x2671,0 xbe63,
0 xac08,0 x511c,0 x6ff0,0 x3e83,
0 xfea3,0 x3dcf,0 x3d7c,0 x3eaa,
0 x24b1,0 x5f32,0 xa556,0 xbed6,
0 xd961,0 x352e,0 x61be,0 xbf00,
0 xf3bd,0 x473b,0 x559b,0 x3f17,
0 x567f,0 x87db,0 x97f5,0 x3f60,
0 xb51b,0 xd464,0 x5126,0 x3f9e,
0 xa8b4,0 xac8c,0 xe548,0 x3ff1
};
static unsigned short S2[] = {
0 x2b4c,0 x8385,0 x487f,0 xbc68,
0 x237f,0 xa1f5,0 x420a,0 x3c7e,
0 xee75,0 x2812,0 x6cad,0 x3c99,
0 x39af,0 x457b,0 x637b,0 xbcb8,
0 xedf9,0 xc086,0 xed01,0 xbccd,
0 x9513,0 x969f,0 xb791,0 x3cf1,
0 xcd11,0 xae46,0 xea62,0 x3d06,
0 x650f,0 xb74a,0 xb518,0 xbd27,
0 x0713,0 x216e,0 xa216,0 xbd46,
0 x9f2e,0 x463a,0 x8db0,0 x3d57,
0 x0dd5,0 x0a69,0 xfa6a,0 x3d87,
0 x9397,0 xd2cd,0 x5c47,0 x3d7d,
0 xb5d8,0 x1fe6,0 x33a7,0 xbdc3,
0 xa2da,0 x9e19,0 xcb8f,0 xbde5,
0 xe7b9,0 xaf5a,0 xa42f,0 xbde8,
0 xd544,0 xb2c4,0 x48f2,0 x3e1e,
0 x8488,0 x3b1d,0 x26d1,0 x3e52,
0 x084c,0 xaf17,0 xd46d,0 x3e80,
0 x3efc,0 xc871,0 x8009,0 x3eb3,
0 xb36e,0 x7f39,0 xe2d6,0 x3ef0,
0 x73d7,0 x1f7d,0 xecd8,0 x3f36,
0 xb790,0 x66d5,0 x4ff3,0 x3f8a,
0 x9d96,0 xe325,0 x9625,0 x3ff0
};
#endif
#ifdef MIEEE
static unsigned short S1[] = {
0 x3c75,0 x3373,0 xbd4a,0 x01b0,
0 xbc9b,0 x8a3d,0 x2418,0 xb05e,
0 x3cad,0 x724d,0 x8248,0 x7fe6,
0 x3cd3,0 xcc1a,0 x2c15,0 x7515,
0 xbd0d,0 x91b5,0 xbaaa,0 xbda0,
0 x3d30,0 xb80c,0 xbe40,0 xd1ae,
0 xbd23,0 x8ba2,0 xe110,0 xbf82,
0 xbd78,0 xa3bb,0 x2541,0 x3725,
0 x3da4,0 xdea5,0 x72b0,0 x9394,
0 xbdb1,0 xc487,0 x33b0,0 x17f7,
0 xbde8,0 x734a,0 xce48,0 x8aac,
0 x3e17,0 x4565,0 x0207,0 x3862,
0 xbe11,0 xbd4b,0 xd68b,0 xfffc,
0 xbe63,0 x2671,0 x2f23,0 xdf61,
0 x3e83,0 x6ff0,0 x511c,0 xac08,
0 x3eaa,0 x3d7c,0 x3dcf,0 xfea3,
0 xbed6,0 xa556,0 x5f32,0 x24b1,
0 xbf00,0 x61be,0 x352e,0 xd961,
0 x3f17,0 x559b,0 x473b,0 xf3bd,
0 x3f60,0 x97f5,0 x87db,0 x567f,
0 x3f9e,0 x5126,0 xd464,0 xb51b,
0 x3ff1,0 xe548,0 xac8c,0 xa8b4
};
static unsigned short S2[] = {
0 xbc68,0 x487f,0 x8385,0 x2b4c,
0 x3c7e,0 x420a,0 xa1f5,0 x237f,
0 x3c99,0 x6cad,0 x2812,0 xee75,
0 xbcb8,0 x637b,0 x457b,0 x39af,
0 xbccd,0 xed01,0 xc086,0 xedf9,
0 x3cf1,0 xb791,0 x969f,0 x9513,
0 x3d06,0 xea62,0 xae46,0 xcd11,
0 xbd27,0 xb518,0 xb74a,0 x650f,
0 xbd46,0 xa216,0 x216e,0 x0713,
0 x3d57,0 x8db0,0 x463a,0 x9f2e,
0 x3d87,0 xfa6a,0 x0a69,0 x0dd5,
0 x3d7d,0 x5c47,0 xd2cd,0 x9397,
0 xbdc3,0 x33a7,0 x1fe6,0 xb5d8,
0 xbde5,0 xcb8f,0 x9e19,0 xa2da,
0 xbde8,0 xa42f,0 xaf5a,0 xe7b9,
0 x3e1e,0 x48f2,0 xb2c4,0 xd544,
0 x3e52,0 x26d1,0 x3b1d,0 x8488,
0 x3e80,0 xd46d,0 xaf17,0 x084c,
0 x3eb3,0 x8009,0 xc871,0 x3efc,
0 x3ef0,0 xe2d6,0 x7f39,0 xb36e,
0 x3f36,0 xecd8,0 x1f7d,0 x73d7,
0 x3f8a,0 x4ff3,0 x66d5,0 xb790,
0 x3ff0,0 x9625,0 xe325,0 x9d96
};
#endif
#ifdef UNK
/* x exp(-x) chin(x), inverted interval 8 to 18 */
static double C1[] = {
-8 .12435385225864036372 E-18 ,
2 .17586413290339214377 E-17 ,
5 .22624394924072204667 E-17 ,
-9 .48812110591690559363 E-16 ,
5 .35546311647465209166 E-15 ,
-1 .21009970113732918701 E-14 ,
-6 .00865178553447437951 E-14 ,
7 .16339649156028587775 E-13 ,
-2 .93496072607599856104 E-12 ,
-1 .40359438136491256904 E-12 ,
8 .76302288609054966081 E-11 ,
-4 .40092476213282340617 E-10 ,
-1 .87992075640569295479 E-10 ,
1 .31458150989474594064 E-8 ,
-4 .75513930924765465590 E-8 ,
-2 .21775018801848880741 E-7 ,
1 .94635531373272490962 E-6 ,
4 .33505889257316408893 E-6 ,
-6 .13387001076494349496 E-5 ,
-3 .13085477492997465138 E-4 ,
4 .97164789823116062801 E-4 ,
2 .64347496031374526641 E-2 ,
1 .11446150876699213025 E0
};
/* x exp(-x) chin(x), inverted interval 18 to 88 */
static double C2[] = {
8 .06913408255155572081 E-18 ,
-2 .08074168180148170312 E-17 ,
-5 .98111329658272336816 E-17 ,
2 .68533951085945765591 E-16 ,
4 .52313941698904694774 E-16 ,
-3 .10734917335299464535 E-15 ,
-4 .42823207332531972288 E-15 ,
3 .49639695410806959872 E-14 ,
6 .63406731718911586609 E-14 ,
-3 .71902448093119218395 E-13 ,
-1 .27135418132338309016 E-12 ,
2 .74851141935315395333 E-12 ,
2 .33781843985453438400 E-11 ,
2 .71436006377612442764 E-11 ,
-2 .56600180000355990529 E-10 ,
-1 .61021375163803438552 E-9 ,
-4 .72543064876271773512 E-9 ,
-3 .00095178028681682282 E-9 ,
7 .79387474390914922337 E-8 ,
1 .06942765566401507066 E-6 ,
1 .59503164802313196374 E-5 ,
3 .49592575153777996871 E-4 ,
1 .28475387530065247392 E-2 ,
1 .03665693917934275131 E0
};
#endif
#ifdef DEC
static unsigned short C1[] = {
0122025 ,0157055 ,0021702 ,0021427 ,
0022310 ,0130043 ,0123265 ,0022340 ,
0022561 ,0002231 ,0017746 ,0013043 ,
0123610 ,0136375 ,0002352 ,0024467 ,
0024300 ,0171555 ,0141300 ,0000446 ,
0124531 ,0176777 ,0126210 ,0035616 ,
0125207 ,0046604 ,0167760 ,0077132 ,
0026111 ,0120666 ,0026606 ,0064143 ,
0126516 ,0103615 ,0054127 ,0005436 ,
0126305 ,0104721 ,0025415 ,0004134 ,
0027700 ,0131556 ,0164725 ,0157553 ,
0130361 ,0170602 ,0077274 ,0055406 ,
0130116 ,0131420 ,0125472 ,0017231 ,
0031541 ,0153747 ,0177312 ,0056304 ,
0132114 ,0035517 ,0041545 ,0043151 ,
0132556 ,0020415 ,0110044 ,0172442 ,
0033402 ,0117041 ,0031152 ,0010364 ,
0033621 ,0072737 ,0050647 ,0013720 ,
0134600 ,0121366 ,0140010 ,0063265 ,
0135244 ,0022637 ,0013756 ,0044742 ,
0035402 ,0052052 ,0006523 ,0043564 ,
0036730 ,0106660 ,0020277 ,0162146 ,
0040216 ,0123254 ,0135147 ,0005724
};
static unsigned short C2[] = {
0022024 ,0154550 ,0104311 ,0144257 ,
0122277 ,0165037 ,0133443 ,0155601 ,
0122611 ,0165102 ,0157053 ,0055252 ,
0023232 ,0146235 ,0153511 ,0113222 ,
0023402 ,0057340 ,0145304 ,0010471 ,
0124137 ,0164171 ,0113071 ,0100002 ,
0124237 ,0105473 ,0056130 ,0022022 ,
0025035 ,0073266 ,0056746 ,0164433 ,
0025225 ,0061313 ,0055600 ,0165407 ,
0125721 ,0056312 ,0107613 ,0051215 ,
0126262 ,0166534 ,0115336 ,0066653 ,
0026501 ,0064307 ,0127442 ,0065573 ,
0027315 ,0121375 ,0142020 ,0045356 ,
0027356 ,0140764 ,0070641 ,0046570 ,
0130215 ,0010503 ,0146335 ,0177737 ,
0130735 ,0047134 ,0015215 ,0163665 ,
0131242 ,0056523 ,0155276 ,0050053 ,
0131116 ,0034515 ,0050707 ,0163512 ,
0032247 ,0057507 ,0107545 ,0032007 ,
0033217 ,0104501 ,0021706 ,0025047 ,
0034205 ,0146413 ,0033746 ,0076562 ,
0035267 ,0044605 ,0065355 ,0002772 ,
0036522 ,0077173 ,0130716 ,0170304 ,
0040204 ,0130454 ,0130571 ,0027270
};
#endif
#ifdef IBMPC
static unsigned short C1[] = {
0 x4463,0 xa478,0 xbbc5,0 xbc62,
0 xa49c,0 x74d6,0 x1604,0 x3c79,
0 xc2c4,0 x23fc,0 x2093,0 x3c8e,
0 x4527,0 xa09d,0 x179f,0 xbcd1,
0 x0025,0 xb858,0 x1e6d,0 x3cf8,
0 x0772,0 xf591,0 x3fbf,0 xbd0b,
0 x0fcb,0 x9dfe,0 xe9b0,0 xbd30,
0 xcd0c,0 xc5b0,0 x3436,0 x3d69,
0 xe164,0 xab0a,0 xd0f1,0 xbd89,
0 xa10c,0 x2561,0 xb13a,0 xbd78,
0 xbbed,0 xdd3a,0 x166d,0 x3dd8,
0 x8b61,0 x4fd7,0 x3e30,0 xbdfe,
0 x43d3,0 x1567,0 xd662,0 xbde9,
0 x4b98,0 xffd9,0 x3afc,0 x3e4c,
0 xa8cd,0 xe86c,0 x8769,0 xbe69,
0 x9ea4,0 xb204,0 xc421,0 xbe8d,
0 x421f,0 x264d,0 x53c4,0 x3ec0,
0 xe2fa,0 xea34,0 x2ebb,0 x3ed2,
0 x0cd7,0 xd801,0 x145e,0 xbf10,
0 xc93c,0 xe2fd,0 x84b3,0 xbf34,
0 x68ef,0 x41aa,0 x4a85,0 x3f40,
0 xfc8d,0 x0417,0 x11b6,0 x3f9b,
0 xe17b,0 x974c,0 xd4d5,0 x3ff1
};
static unsigned short C2[] = {
0 x3916,0 x1119,0 x9b2d,0 x3c62,
0 x7b70,0 xf6e4,0 xfd43,0 xbc77,
0 x6b55,0 x5bc5,0 x3d48,0 xbc91,
0 x32d2,0 xbae9,0 x5993,0 x3cb3,
0 x8227,0 x1958,0 x4bdc,0 x3cc0,
0 x3000,0 x32c7,0 xfd0f,0 xbceb,
0 x0482,0 x6b8b,0 xf167,0 xbcf3,
0 xdd23,0 xcbbc,0 xaed6,0 x3d23,
0 x1d61,0 x6b70,0 xac59,0 x3d32,
0 x6a52,0 x51f1,0 x2b99,0 xbd5a,
0 xcdb5,0 x935b,0 x5dab,0 xbd76,
0 x4d6f,0 xf5e4,0 x2d18,0 x3d88,
0 x095e,0 xb882,0 xb45f,0 x3db9,
0 x29af,0 x8e34,0 xd83e,0 x3dbd,
0 xbffc,0 x799b,0 xa228,0 xbdf1,
0 xbcf7,0 x8351,0 xa9cb,0 xbe1b,
0 xca05,0 x7b57,0 x4baa,0 xbe34,
0 xfce9,0 xaa38,0 xc729,0 xbe29,
0 xa681,0 xf1ec,0 xebe8,0 x3e74,
0 xc545,0 x2478,0 xf128,0 x3eb1,
0 xcfae,0 x66fc,0 xb9a1,0 x3ef0,
0 xa0bf,0 xad5d,0 xe930,0 x3f36,
0 xde19,0 x7639,0 x4fcf,0 x3f8a,
0 x25d7,0 x962f,0 x9625,0 x3ff0
};
#endif
#ifdef MIEEE
static unsigned short C1[] = {
0 xbc62,0 xbbc5,0 xa478,0 x4463,
0 x3c79,0 x1604,0 x74d6,0 xa49c,
0 x3c8e,0 x2093,0 x23fc,0 xc2c4,
0 xbcd1,0 x179f,0 xa09d,0 x4527,
0 x3cf8,0 x1e6d,0 xb858,0 x0025,
0 xbd0b,0 x3fbf,0 xf591,0 x0772,
0 xbd30,0 xe9b0,0 x9dfe,0 x0fcb,
0 x3d69,0 x3436,0 xc5b0,0 xcd0c,
0 xbd89,0 xd0f1,0 xab0a,0 xe164,
0 xbd78,0 xb13a,0 x2561,0 xa10c,
0 x3dd8,0 x166d,0 xdd3a,0 xbbed,
0 xbdfe,0 x3e30,0 x4fd7,0 x8b61,
0 xbde9,0 xd662,0 x1567,0 x43d3,
0 x3e4c,0 x3afc,0 xffd9,0 x4b98,
0 xbe69,0 x8769,0 xe86c,0 xa8cd,
0 xbe8d,0 xc421,0 xb204,0 x9ea4,
0 x3ec0,0 x53c4,0 x264d,0 x421f,
0 x3ed2,0 x2ebb,0 xea34,0 xe2fa,
0 xbf10,0 x145e,0 xd801,0 x0cd7,
0 xbf34,0 x84b3,0 xe2fd,0 xc93c,
0 x3f40,0 x4a85,0 x41aa,0 x68ef,
0 x3f9b,0 x11b6,0 x0417,0 xfc8d,
0 x3ff1,0 xd4d5,0 x974c,0 xe17b
};
static unsigned short C2[] = {
0 x3c62,0 x9b2d,0 x1119,0 x3916,
0 xbc77,0 xfd43,0 xf6e4,0 x7b70,
0 xbc91,0 x3d48,0 x5bc5,0 x6b55,
0 x3cb3,0 x5993,0 xbae9,0 x32d2,
0 x3cc0,0 x4bdc,0 x1958,0 x8227,
0 xbceb,0 xfd0f,0 x32c7,0 x3000,
0 xbcf3,0 xf167,0 x6b8b,0 x0482,
0 x3d23,0 xaed6,0 xcbbc,0 xdd23,
0 x3d32,0 xac59,0 x6b70,0 x1d61,
0 xbd5a,0 x2b99,0 x51f1,0 x6a52,
0 xbd76,0 x5dab,0 x935b,0 xcdb5,
0 x3d88,0 x2d18,0 xf5e4,0 x4d6f,
0 x3db9,0 xb45f,0 xb882,0 x095e,
0 x3dbd,0 xd83e,0 x8e34,0 x29af,
0 xbdf1,0 xa228,0 x799b,0 xbffc,
0 xbe1b,0 xa9cb,0 x8351,0 xbcf7,
0 xbe34,0 x4baa,0 x7b57,0 xca05,
0 xbe29,0 xc729,0 xaa38,0 xfce9,
0 x3e74,0 xebe8,0 xf1ec,0 xa681,
0 x3eb1,0 xf128,0 x2478,0 xc545,
0 x3ef0,0 xb9a1,0 x66fc,0 xcfae,
0 x3f36,0 xe930,0 xad5d,0 xa0bf,
0 x3f8a,0 x4fcf,0 x7639,0 xde19,
0 x3ff0,0 x9625,0 x962f,0 x25d7
};
#endif
/* Sine and cosine integrals */
#ifdef ANSIPROT
extern double log ( double );
extern double exp ( double );
extern double fabs ( double );
extern double chbevl ( double , void *, int );
#else
double log(), exp(), fabs(), chbevl();
#endif
#define EUL 0 .57721566490153286061
extern double MACHEP, MAXNUM, PIO2;
int shichi( x, si, ci )
double x;
double *si, *ci;
{
double k, z, c, s, a;
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 >= 8 .0 )
goto chb;
z = x * x;
/* Direct power series expansion */
a = 1 .0 ;
s = 1 .0 ;
c = 0 .0 ;
k = 2 .0 ;
do
{
a *= z/k;
c += a/k;
k += 1 .0 ;
a /= k;
s += a/k;
k += 1 .0 ;
}
while ( fabs(a/s) > MACHEP );
s *= x;
goto done;
chb:
if ( x < 18 .0 )
{
a = (576 .0 /x - 52 .0 )/10 .0 ;
k = exp(x) / x;
s = k * chbevl( a, S1, 22 );
c = k * chbevl( a, C1, 23 );
goto done;
}
if ( x <= 88 .0 )
{
a = (6336 .0 /x - 212 .0 )/70 .0 ;
k = exp(x) / x;
s = k * chbevl( a, S2, 23 );
c = k * chbevl( a, C2, 24 );
goto done;
}
else
{
if ( sign )
*si = -MAXNUM;
else
*si = MAXNUM;
*ci = MAXNUM;
return (0 );
}
done:
if ( sign )
s = -s;
*si = s;
*ci = EUL + log(x) + c;
return (0 );
}
Messung V0.5 in Prozent C=99 H=86 G=92