/* zetac.c
*
* Riemann zeta function
*
*
*
* SYNOPSIS :
*
* double x , y , zetac ( ) ;
*
* y = zetac ( x ) ;
*
*
*
* DESCRIPTION :
*
*
*
* inf .
* - - x
* zetac ( x ) = > k , x > 1 ,
* -
* k = 2
*
* is related to the Riemann zeta function by
*
* Riemann zeta ( x ) = zetac ( x ) + 1 .
*
* Extension of the function definition for x < 1 is implemented .
* Zero is returned for x > log2 ( MAXNUM ) .
*
* An overflow error may occur for large negative x , due to the
* gamma function in the reflection formula .
*
* ACCURACY :
*
* Tabulated values have full machine accuracy .
*
* Relative error :
* arithmetic domain # trials peak rms
* IEEE 1 , 50 10000 9 . 8 e - 16 1 . 3 e - 16
* DEC 1 , 50 2000 1 . 1 e - 16 1 . 9 e - 17
*
*
*/
/*
Cephes Math Library Release 2 . 8 : June , 2000
Copyright 1984 , 1987 , 1989 , 2000 by Stephen L . Moshier
*/
#include "mconf.h"
extern double MAXNUM, PI;
/* Riemann zeta(x) - 1
* for integer arguments between 0 and 30 .
*/
#ifdef UNK
static double azetac[] = {
-1 .50000000000000000000 E0, 1 .70141183460469231730 E38, /* infinity. */
6 .44934066848226436472 E-1 , 2 .02056903159594285400 E-1 ,
8 .23232337111381915160 E-2 , 3 .69277551433699263314 E-2 ,
1 .73430619844491397145 E-2 , 8 .34927738192282683980 E-3 ,
4 .07735619794433937869 E-3 , 2 .00839282608221441785 E-3 ,
9 .94575127818085337146 E-4 , 4 .94188604119464558702 E-4 ,
2 .46086553308048298638 E-4 , 1 .22713347578489146752 E-4 ,
6 .12481350587048292585 E-5 , 3 .05882363070204935517 E-5 ,
1 .52822594086518717326 E-5 , 7 .63719763789976227360 E-6 ,
3 .81729326499983985646 E-6 , 1 .90821271655393892566 E-6 ,
9 .53962033872796113152 E-7 , 4 .76932986787806463117 E-7 ,
2 .38450502727732990004 E-7 , 1 .19219925965311073068 E-7 ,
5 .96081890512594796124 E-8 , 2 .98035035146522801861 E-8 ,
1 .49015548283650412347 E-8 , 7 .45071178983542949198 E-9 ,
3 .72533402478845705482 E-9 , 1 .86265972351304900640 E-9 ,
9 .31327432419668182872 E-10 };
#endif
#ifdef DEC
static unsigned short azetac[] = {
0140300 , 0000000 , 0000000 , 0000000 , 0077777 , 0177777 , 0177777 , 0177777 ,
0040045 , 0015146 , 0022460 , 0076462 , 0037516 , 0164001 , 0036001 , 0104116 ,
0037250 , 0114425 , 0061754 , 0022033 , 0037027 , 0040616 , 0145174 , 0146670 ,
0036616 , 0011411 , 0100444 , 0104437 , 0036410 , 0145550 , 0051474 , 0161067 ,
0036205 , 0115527 , 0141434 , 0133506 , 0036003 , 0117475 , 0100553 , 0053403 ,
0035602 , 0056147 , 0045567 , 0027703 , 0035401 , 0106157 , 0111054 , 0145242 ,
0035201 , 0002455 , 0113151 , 0101015 , 0035000 , 0126235 , 0004273 , 0157260 ,
0034600 , 0071127 , 0112647 , 0005261 , 0034400 , 0045736 , 0057610 , 0157550 ,
0034200 , 0031146 , 0172621 , 0074172 , 0034000 , 0020603 , 0115503 , 0032007 ,
0033600 , 0013114 , 0124672 , 0023135 , 0033400 , 0007330 , 0043715 , 0151117 ,
0033200 , 0004742 , 0145043 , 0033514 , 0033000 , 0003225 , 0152624 , 0004411 ,
0032600 , 0002143 , 0033166 , 0035746 , 0032400 , 0001354 , 0074234 , 0026143 ,
0032200 , 0000762 , 0147776 , 0170220 , 0032000 , 0000514 , 0072452 , 0130631 ,
0031600 , 0000335 , 0114266 , 0063315 , 0031400 , 0000223 , 0132710 , 0041045 ,
0031200 , 0000142 , 0073202 , 0153426 , 0031000 , 0000101 , 0121400 , 0152065 ,
0030600 , 0000053 , 0140525 , 0072761 };
#endif
#ifdef IBMPC
static unsigned short azetac[] = {
0 x0000, 0 x0000, 0 x0000, 0 xbff8, 0 xffff, 0 xffff, 0 xffff, 0 x7fef, 0 x0fa6,
0 xc4a6, 0 xa34c, 0 x3fe4, 0 x310a, 0 x2780, 0 xdd00, 0 x3fc9, 0 x8483, 0 xac7d,
0 x1322, 0 x3fb5, 0 x99b7, 0 xd94f, 0 xe831, 0 x3fa2, 0 x9124, 0 x3024, 0 xc261,
0 x3f91, 0 x9c47, 0 x0a67, 0 x196d, 0 x3f81, 0 x96e9, 0 xf863, 0 xb36a, 0 x3f70,
0 x6ae0, 0 xb02d, 0 x73e7, 0 x3f60, 0 xe5f8, 0 xe96e, 0 x4b8c, 0 x3f50, 0 x9954,
0 xf245, 0 x318d, 0 x3f40, 0 x3042, 0 xb2cd, 0 x20a5, 0 x3f30, 0 x7bd6, 0 xa117,
0 x1593, 0 x3f20, 0 xe156, 0 xf2b4, 0 x0e4a, 0 x3f10, 0 x1bed, 0 xcbf1, 0 x097b,
0 x3f00, 0 x2f0f, 0 xdeb2, 0 x064c, 0 x3ef0, 0 x6681, 0 x7368, 0 x0430, 0 x3ee0,
0 x44cc, 0 x9537, 0 x02c9, 0 x3ed0, 0 xba4a, 0 x08f9, 0 x01db, 0 x3ec0, 0 x66ea,
0 x5944, 0 x013c, 0 x3eb0, 0 x8121, 0 xbab2, 0 x00d2, 0 x3ea0, 0 xc77d, 0 x66ce,
0 x008c, 0 x3e90, 0 x858c, 0 x8f13, 0 x005d, 0 x3e80, 0 xde12, 0 x59ff, 0 x003e,
0 x3e70, 0 x5633, 0 x8ea5, 0 x0029, 0 x3e60, 0 xccda, 0 xb316, 0 x001b, 0 x3e50,
0 x0845, 0 x76b9, 0 x0012, 0 x3e40, 0 x5ae3, 0 x4ed0, 0 x000c, 0 x3e30, 0 x1a87,
0 x3460, 0 x0008, 0 x3e20, 0 xaebe, 0 x782a, 0 x0005, 0 x3e10};
#endif
#ifdef MIEEE
static unsigned short azetac[] = {
0 xbff8, 0 x0000, 0 x0000, 0 x0000, 0 x7fef, 0 xffff, 0 xffff, 0 xffff, 0 x3fe4,
0 xa34c, 0 xc4a6, 0 x0fa6, 0 x3fc9, 0 xdd00, 0 x2780, 0 x310a, 0 x3fb5, 0 x1322,
0 xac7d, 0 x8483, 0 x3fa2, 0 xe831, 0 xd94f, 0 x99b7, 0 x3f91, 0 xc261, 0 x3024,
0 x9124, 0 x3f81, 0 x196d, 0 x0a67, 0 x9c47, 0 x3f70, 0 xb36a, 0 xf863, 0 x96e9,
0 x3f60, 0 x73e7, 0 xb02d, 0 x6ae0, 0 x3f50, 0 x4b8c, 0 xe96e, 0 xe5f8, 0 x3f40,
0 x318d, 0 xf245, 0 x9954, 0 x3f30, 0 x20a5, 0 xb2cd, 0 x3042, 0 x3f20, 0 x1593,
0 xa117, 0 x7bd6, 0 x3f10, 0 x0e4a, 0 xf2b4, 0 xe156, 0 x3f00, 0 x097b, 0 xcbf1,
0 x1bed, 0 x3ef0, 0 x064c, 0 xdeb2, 0 x2f0f, 0 x3ee0, 0 x0430, 0 x7368, 0 x6681,
0 x3ed0, 0 x02c9, 0 x9537, 0 x44cc, 0 x3ec0, 0 x01db, 0 x08f9, 0 xba4a, 0 x3eb0,
0 x013c, 0 x5944, 0 x66ea, 0 x3ea0, 0 x00d2, 0 xbab2, 0 x8121, 0 x3e90, 0 x008c,
0 x66ce, 0 xc77d, 0 x3e80, 0 x005d, 0 x8f13, 0 x858c, 0 x3e70, 0 x003e, 0 x59ff,
0 xde12, 0 x3e60, 0 x0029, 0 x8ea5, 0 x5633, 0 x3e50, 0 x001b, 0 xb316, 0 xccda,
0 x3e40, 0 x0012, 0 x76b9, 0 x0845, 0 x3e30, 0 x000c, 0 x4ed0, 0 x5ae3, 0 x3e20,
0 x0008, 0 x3460, 0 x1a87, 0 x3e10, 0 x0005, 0 x782a, 0 xaebe};
#endif
/* 2**x (1 - 1/x) (zeta(x) - 1) = P(1/x)/Q(1/x), 1 <= x <= 10 */
#ifdef UNK
static double P[9 ] = {
5 .85746514569725319540 E11, 2 .57534127756102572888 E11,
4 .87781159567948256438 E10, 5 .15399538023885770696 E9,
3 .41646073514754094281 E8, 1 .60837006880656492731 E7,
5 .92785467342109522998 E5, 1 .51129169964938823117 E4,
2 .01822444485997955865 E2,
};
static double Q[8 ] = {
/* 1.00000000000000000000E0,*/
3 .90497676373371157516 E11, 5 .22858235368272161797 E10,
5 .64451517271280543351 E9, 3 .39006746015350418834 E8,
1 .79410371500126453702 E7, 5 .66666825131384797029 E5,
1 .60382976810944131506 E4, 1 .96436237223387314144 E2,
};
#endif
#ifdef DEC
static unsigned short P[36 ] = {
0052010 , 0060466 , 0101211 , 0134657 , 0051557 , 0154353 , 0135060 , 0064411 ,
0051065 , 0133157 , 0133514 , 0133633 , 0050231 , 0114735 , 0035036 , 0111344 ,
0047242 , 0164327 , 0146036 , 0033545 , 0046165 , 0065364 , 0130045 , 0011005 ,
0045020 , 0134427 , 0075073 , 0134107 , 0043554 , 0021653 , 0000440 , 0177426 ,
0042111 , 0151213 , 0134312 , 0021402 ,
};
static unsigned short Q[32 ] = {
/*0040200,0000000,0000000,0000000,*/
0051665 , 0153363 , 0054252 , 0137010 , 0051102 , 0143645 , 0121415 , 0036107 ,
0050250 , 0034073 , 0131133 , 0036465 , 0047241 , 0123250 , 0150037 , 0070012 ,
0046210 , 0160426 , 0111463 , 0116507 , 0045012 , 0054255 , 0031674 , 0173612 ,
0043572 , 0114460 , 0151520 , 0012221 , 0042104 , 0067655 , 0037037 , 0137421 ,
};
#endif
#ifdef IBMPC
static unsigned short P[36 ] = {
0 x3736, 0 xd051, 0 x0c26, 0 x4261, 0 x0d21, 0 x7746, 0 xfb1d, 0 x424d, 0 x96f3,
0 xf6e9, 0 xb6cd, 0 x4226, 0 xd25c, 0 xa743, 0 x333b, 0 x41f3, 0 xc6ed, 0 xf983,
0 x5d1a, 0 x41b4, 0 xa241, 0 x9604, 0 xad5e, 0 x416e, 0 x7709, 0 xef47, 0 x1722,
0 x4122, 0 x1fe3, 0 x6024, 0 x8475, 0 x40cd, 0 x4460, 0 x7719, 0 x3a51, 0 x4069,
};
static unsigned short Q[32 ] = {
/*0x0000,0x0000,0x0000,0x3ff0,*/
0 x57c1, 0 x6b15, 0 xbade, 0 x4256, 0 xa789, 0 xb461, 0 x58f4, 0 x4228,
0 x67a7, 0 x764b, 0 x0707, 0 x41f5, 0 xee01, 0 x1a03, 0 x34d5, 0 x41b4,
0 x73a9, 0 xd266, 0 x1c22, 0 x4171, 0 x9ef1, 0 xa677, 0 x4b15, 0 x4121,
0 x0292, 0 x1a6a, 0 x5326, 0 x40cf, 0 xf7e2, 0 xa7c3, 0 x8df5, 0 x4068,
};
#endif
#ifdef MIEEE
static unsigned short P[36 ] = {
0 x4261, 0 x0c26, 0 xd051, 0 x3736, 0 x424d, 0 xfb1d, 0 x7746, 0 x0d21, 0 x4226,
0 xb6cd, 0 xf6e9, 0 x96f3, 0 x41f3, 0 x333b, 0 xa743, 0 xd25c, 0 x41b4, 0 x5d1a,
0 xf983, 0 xc6ed, 0 x416e, 0 xad5e, 0 x9604, 0 xa241, 0 x4122, 0 x1722, 0 xef47,
0 x7709, 0 x40cd, 0 x8475, 0 x6024, 0 x1fe3, 0 x4069, 0 x3a51, 0 x7719, 0 x4460,
};
static unsigned short Q[32 ] = {
/*0x3ff0,0x0000,0x0000,0x0000,*/
0 x4256, 0 xbade, 0 x6b15, 0 x57c1, 0 x4228, 0 x58f4, 0 xb461, 0 xa789,
0 x41f5, 0 x0707, 0 x764b, 0 x67a7, 0 x41b4, 0 x34d5, 0 x1a03, 0 xee01,
0 x4171, 0 x1c22, 0 xd266, 0 x73a9, 0 x4121, 0 x4b15, 0 xa677, 0 x9ef1,
0 x40cf, 0 x5326, 0 x1a6a, 0 x0292, 0 x4068, 0 x8df5, 0 xa7c3, 0 xf7e2,
};
#endif
/* log(zeta(x) - 1 - 2**-x), 10 <= x <= 50 */
#ifdef UNK
static double A[11 ] = {
8 .70728567484590192539 E6, 1 .76506865670346462757 E8,
2 .60889506707483264896 E10, 5 .29806374009894791647 E11,
2 .26888156119238241487 E13, 3 .31884402932705083599 E14,
5 .13778997975868230192 E15, -1 .98123688133907171455 E15,
-9 .92763810039983572356 E16, 7 .82905376180870586444 E16,
9 .26786275768927717187 E16,
};
static double B[10 ] = {
/* 1.00000000000000000000E0,*/
-7 .92625410563741062861 E6, -1 .60529969932920229676 E8,
-2 .37669260975543221788 E10, -4 .80319584350455169857 E11,
-2 .07820961754173320170 E13, -2 .96075404507272223680 E14,
-4 .86299103694609136686 E15, 5 .34589509675789930199 E15,
5 .71464111092297631292 E16, -1 .79915597658676556828 E16,
};
#endif
#ifdef DEC
static unsigned short A[44 ] = {
0046004 , 0156325 , 0126302 , 0131567 , 0047050 , 0052177 , 0015271 , 0136466 ,
0050702 , 0060271 , 0070727 , 0171112 , 0051766 , 0132727 , 0064363 , 0145042 ,
0053245 , 0012466 , 0056000 , 0117230 , 0054226 , 0166155 , 0174275 , 0170213 ,
0055222 , 0003127 , 0112544 , 0101322 , 0154741 , 0036625 , 0010346 , 0053767 ,
0156260 , 0054653 , 0154052 , 0031113 , 0056213 , 0011152 , 0021000 , 0007111 ,
0056244 , 0120534 , 0040576 , 0163262 ,
};
static unsigned short B[40 ] = {
/*0040200,0000000,0000000,0000000,*/
0145761 , 0161734 , 0033026 , 0015520 , 0147031 , 0013743 , 0017355 , 0036703 ,
0150661 , 0011720 , 0061061 , 0136402 , 0151737 , 0125216 , 0070274 , 0164414 ,
0153227 , 0032653 , 0127211 , 0145250 , 0154206 , 0121666 , 0123774 , 0042035 ,
0155212 , 0033352 , 0125154 , 0132533 , 0055227 , 0170201 , 0110775 , 0072132 ,
0056113 , 0003133 , 0127132 , 0122303 , 0155577 , 0126351 , 0141462 , 0171037 ,
};
#endif
#ifdef IBMPC
static unsigned short A[44 ] = {
0 x566f, 0 xb598, 0 x9b9a, 0 x4160, 0 x37a7, 0 xe357, 0 x0a8f, 0 x41a5, 0 xfe49,
0 x2e3a, 0 x4c17, 0 x4218, 0 x7944, 0 xed1e, 0 xd6ba, 0 x425e, 0 x13d3, 0 xcb80,
0 xa2a6, 0 x42b4, 0 xbe11, 0 xbf17, 0 xdd8d, 0 x42f2, 0 x905a, 0 xf2ac, 0 x40ca,
0 x4332, 0 xcaff, 0 xa21c, 0 x27b2, 0 xc31c, 0 x4649, 0 x7b05, 0 x0b35, 0 xc376,
0 x01c9, 0 x4440, 0 x624d, 0 x4371, 0 xdcd6, 0 x882f, 0 x942b, 0 x4374,
};
static unsigned short B[40 ] = {
/*0x0000,0x0000,0x0000,0x3ff0,*/
0 xc36a, 0 x86c2, 0 x3c7b, 0 xc15e, 0 xa7b8, 0 x63dd, 0 x22fc, 0 xc1a3,
0 x37a0, 0 x0c46, 0 x227a, 0 xc216, 0 x9d22, 0 xce17, 0 xf551, 0 xc25b,
0 x3955, 0 x75d1, 0 xe6b5, 0 xc2b2, 0 x8884, 0 xd4ff, 0 xd476, 0 xc2f0,
0 x96ab, 0 x554d, 0 x46dd, 0 xc331, 0 xae8b, 0 x323f, 0 xfe10, 0 x4332,
0 x5498, 0 x75cb, 0 x60cb, 0 x4369, 0 x5e44, 0 x3866, 0 xf59d, 0 xc34f,
};
#endif
#ifdef MIEEE
static unsigned short A[44 ] = {
0 x4160, 0 x9b9a, 0 xb598, 0 x566f, 0 x41a5, 0 x0a8f, 0 xe357, 0 x37a7, 0 x4218,
0 x4c17, 0 x2e3a, 0 xfe49, 0 x425e, 0 xd6ba, 0 xed1e, 0 x7944, 0 x42b4, 0 xa2a6,
0 xcb80, 0 x13d3, 0 x42f2, 0 xdd8d, 0 xbf17, 0 xbe11, 0 x4332, 0 x40ca, 0 xf2ac,
0 x905a, 0 xc31c, 0 x27b2, 0 xa21c, 0 xcaff, 0 xc376, 0 x0b35, 0 x7b05, 0 x4649,
0 x4371, 0 x624d, 0 x4440, 0 x01c9, 0 x4374, 0 x942b, 0 x882f, 0 xdcd6,
};
static unsigned short B[40 ] = {
/*0x3ff0,0x0000,0x0000,0x0000,*/
0 xc15e, 0 x3c7b, 0 x86c2, 0 xc36a, 0 xc1a3, 0 x22fc, 0 x63dd, 0 xa7b8,
0 xc216, 0 x227a, 0 x0c46, 0 x37a0, 0 xc25b, 0 xf551, 0 xce17, 0 x9d22,
0 xc2b2, 0 xe6b5, 0 x75d1, 0 x3955, 0 xc2f0, 0 xd476, 0 xd4ff, 0 x8884,
0 xc331, 0 x46dd, 0 x554d, 0 x96ab, 0 x4332, 0 xfe10, 0 x323f, 0 xae8b,
0 x4369, 0 x60cb, 0 x75cb, 0 x5498, 0 xc34f, 0 xf59d, 0 x3866, 0 x5e44,
};
#endif
/* (1-x) (zeta(x) - 1), 0 <= x <= 1 */
#ifdef UNK
static double R[6 ] = {
-3 .28717474506562731748 E-1 , 1 .55162528742623950834 E1,
-2 .48762831680821954401 E2, 1 .01050368053237678329 E3,
1 .26726061410235149405 E4, -1 .11578094770515181334 E5,
};
static double S[5 ] = {
/* 1.00000000000000000000E0,*/
1 .95107674914060531512 E1, 3 .17710311750646984099 E2,
3 .03835500874445748734 E3, 2 .03665876435770579345 E4,
7 .43853965136767874343 E4,
};
#endif
#ifdef DEC
static unsigned short R[24 ] = {
0137650 , 0046650 , 0022502 , 0040316 , 0041170 , 0041222 , 0057666 , 0142216 ,
0142170 , 0141510 , 0167741 , 0075646 , 0042574 , 0120074 , 0046505 , 0106053 ,
0043506 , 0001154 , 0130073 , 0101413 , 0144331 , 0166414 , 0020560 , 0131652 ,
};
static unsigned short S[20 ] = {
/*0040200,0000000,0000000,0000000,*/
0041234 , 0013015 , 0042073 , 0113570 , 0042236 , 0155353 , 0077325 ,
0077445 , 0043075 , 0162656 , 0016646 , 0031723 , 0043637 , 0016454 ,
0157636 , 0071126 , 0044221 , 0044262 , 0140365 , 0146434 ,
};
#endif
#ifdef IBMPC
static unsigned short R[24 ] = {
0 x481a, 0 x04a8, 0 x09b5, 0 xbfd5, 0 xd892, 0 x4bf6, 0 x0852, 0 x402f,
0 x2f75, 0 x1dfc, 0 x1869, 0 xc06f, 0 xb185, 0 x89a8, 0 x9407, 0 x408f,
0 x7061, 0 x9607, 0 xc04d, 0 x40c8, 0 x1675, 0 x842e, 0 x3da1, 0 xc0fb,
};
static unsigned short S[20 ] = {
/*0x0000,0x0000,0x0000,0x3ff0,*/
0 x72ef, 0 xa887, 0 x82c1, 0 x4033, 0 xafe5, 0 x6fda, 0 xdb5d,
0 x4073, 0 xc67a, 0 xc3b4, 0 xbcb5, 0 x40a7, 0 xce4b, 0 x9bf3,
0 xe3a5, 0 x40d3, 0 xb9a3, 0 x581e, 0 x2916, 0 x40f2,
};
#endif
#ifdef MIEEE
static unsigned short R[24 ] = {
0 xbfd5, 0 x09b5, 0 x04a8, 0 x481a, 0 x402f, 0 x0852, 0 x4bf6, 0 xd892,
0 xc06f, 0 x1869, 0 x1dfc, 0 x2f75, 0 x408f, 0 x9407, 0 x89a8, 0 xb185,
0 x40c8, 0 xc04d, 0 x9607, 0 x7061, 0 xc0fb, 0 x3da1, 0 x842e, 0 x1675,
};
static unsigned short S[20 ] = {
/*0x3ff0,0x0000,0x0000,0x0000,*/
0 x4033, 0 x82c1, 0 xa887, 0 x72ef, 0 x4073, 0 xdb5d, 0 x6fda,
0 xafe5, 0 x40a7, 0 xbcb5, 0 xc3b4, 0 xc67a, 0 x40d3, 0 xe3a5,
0 x9bf3, 0 xce4b, 0 x40f2, 0 x2916, 0 x581e, 0 xb9a3,
};
#endif
#define MAXL2 127
/*
* Riemann zeta function , minus one
*/
#ifdef ANSIPROT
extern double sin(double );
extern double floor(double );
extern double gamma(double );
extern double pow(double , double );
extern double exp(double );
extern double polevl(double , void *, int );
extern double p1evl(double , void *, int );
double zetac(double );
#else
double sin(), floor(), gamma(), pow(), exp();
double polevl(), p1evl(), zetac();
#endif
extern double MACHEP;
double zetac(x) double x;
{
int i;
double a, b, s, w;
if (x < 0 .0 ) {
#ifdef DEC
if (x < -30 .8148 )
#else
if (x < -170 .6243 )
#endif
{
mtherr("zetac" , OVERFLOW);
return (0 .0 );
}
s = 1 .0 - x;
w = zetac(s);
b = sin(0 .5 * PI * x) * pow(2 .0 * PI, x) * gamma(s) * (1 .0 + w) / PI;
return (b - 1 .0 );
}
if (x >= MAXL2)
return (0 .0 ); /* because first term is 2**-x */
/* Tabulated values for integer argument */
w = floor(x);
if (w == x) {
i = x;
if (i < 31 ) {
#ifdef UNK
return (azetac[i]);
#else
return (*(double *)&azetac[4 * i]);
#endif
}
}
if (x < 1 .0 ) {
w = 1 .0 - x;
a = polevl(x, R, 5 ) / (w * p1evl(x, S, 5 ));
return (a);
}
if (x == 1 .0 ) {
mtherr("zetac" , SING);
return (MAXNUM);
}
if (x <= 10 .0 ) {
b = pow(2 .0 , x) * (x - 1 .0 );
w = 1 .0 / x;
s = (x * polevl(w, P, 8 )) / (b * p1evl(w, Q, 8 ));
return (s);
}
if (x <= 50 .0 ) {
b = pow(2 .0 , -x);
w = polevl(x, A, 10 ) / p1evl(x, B, 10 );
w = exp(w) + b;
return (w);
}
/* Basic sum of inverse powers */
s = 0 .0 ;
a = 1 .0 ;
do {
a += 2 .0 ;
b = pow(a, -x);
s += b;
} while (b / s > MACHEP);
b = pow(2 .0 , -x);
s = (s + b) / (1 .0 - b);
return (s);
}
Messung V0.5 in Prozent C=94 H=89 G=91