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.0: April, 1987
59
Copyright 1984, 1987 by Stephen L. Moshier
60
Direct inquiries to 30 Frost Street, Cambridge, MA 02140
66
extern double MAXNUM, MACHEP;
68
/* Expansion coefficients
69
* for Euler-Maclaurin summation formula
71
* where B2k are Bernoulli numbers
79
-1.8924375803183791606e9, /*1.307674368e12/691*/
81
-2.950130727918164224e12, /*1.067062284288e16/3617*/
82
1.1646782814350067249e14, /*5.109094217170944e18/43867*/
83
-4.5979787224074726105e15, /*8.028576626982912e20/174611*/
84
1.8152105401943546773e17, /*1.5511210043330985984e23/854513*/
85
-7.1661652561756670113e18 /*1.6938241367317436694528e27/236364091*/
87
/* 30 Nov 86 -- error in third coefficient fixed */
94
double a, b, k, s, t, w;
102
mtherr( "zeta", DOMAIN );
110
mtherr( "zeta", SING );
115
goto domerr; /* because q^-x not defined */
118
/* Euler-Maclaurin summation formula */
123
/* Permit negative q but continue sum until n+q > +9 .
124
* This case should be handled by a reflection formula.
125
* If q<0 and x is an integer, there is a relation to
126
* the polygamma function.
132
while( (i < 9) || (a <= 9.0) )
138
if( fabs(b/s) < MACHEP )
147
for( i=0; i<12; i++ )
167
/* Basic sum of inverse powers */
179
while( b/s > MACHEP );