3 * Riemann zeta function of two arguments
9 * double x, q, y, zeta();
25 * where x > 1 and q is not a negative integer or zero.
26 * The Euler-Maclaurin summation formula is used to obtain
35 * 1-x inf. B x(x+1)...(x+2j)
37 * + --------- - ------- + > --------------------
39 * 2(n+q) j=1 (2j)! (n+q)
41 * where the B2j are Bernoulli numbers. Note that (see zetac.c)
42 * zeta(x,1) = zetac(x) + 1.
52 * Gradshteyn, I. S., and I. M. Ryzhik, Tables of Integrals,
53 * Series, and Products, p. 1073; Academic Press, 1980.
58 Cephes Math Library Release 2.8: June, 2000
59 Copyright 1984, 1987, 2000 by Stephen L. Moshier
64 extern double fabs ( double );
65 extern double pow ( double, double );
66 extern double floor ( double );
68 double fabs(), pow(), floor();
70 extern double MAXNUM, MACHEP;
72 /* Expansion coefficients
73 * for Euler-Maclaurin summation formula
75 * where B2k are Bernoulli numbers
83 -1.8924375803183791606e9, /*1.307674368e12/691*/
85 -2.950130727918164224e12, /*1.067062284288e16/3617*/
86 1.1646782814350067249e14, /*5.109094217170944e18/43867*/
87 -4.5979787224074726105e15, /*8.028576626982912e20/174611*/
88 1.8152105401943546773e17, /*1.5511210043330985984e23/854513*/
89 -7.1661652561756670113e18 /*1.6938241367317436694528e27/236364091*/
91 /* 30 Nov 86 -- error in third coefficient fixed */
98 double a, b, k, s, t, w;
106 mtherr( "zeta", DOMAIN );
114 mtherr( "zeta", SING );
119 goto domerr; /* because q^-x not defined */
122 /* Euler-Maclaurin summation formula */
127 /* Permit negative q but continue sum until n+q > +9 .
128 * This case should be handled by a reflection formula.
129 * If q<0 and x is an integer, there is a relation to
130 * the polygamma function.
136 while( (i < 9) || (a <= 9.0) )
142 if( fabs(b/s) < MACHEP )
151 for( i=0; i<12; i++ )
171 /* Basic sum of inverse powers */
183 while( b/s > MACHEP );