Hurwitz zeta function .
Computes the Hurwitz zeta function, a two-argument generalisation of the Riemann zeta that arises in moment-generating functions of discrete distributions, in expansions of polygamma functions, and as a regulariser in analytic number theory.
Parameters
Returns
Tensor element-wise, broadcast to the common shape
of x and q.
Notes
Series definition:
The implementation accumulates an explicit prefix of 12 terms and closes the tail with the Euler–Maclaurin correction
where and the are Bernoulli
numbers; that is accurate to float64 rounding for
and . A negative non-integer q is real only for
an integer x and is reduced to positive arguments; otherwise it
is NaN. The non-positive integers q are poles (+inf),
x = 1 is +inf and x < 1 is NaN. The Riemann zeta is the
special case .
Examples
>>> import lucid
>>> from lucid.special import zeta
>>> x = lucid.tensor([2.0, 3.0])
>>> q = lucid.tensor([1.0, 1.0])
>>> zeta(x, q)
tensor([1.645, 1.202])