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 input and other.
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 other is real only for
an integer input and is reduced to positive arguments; otherwise it
is NaN. The non-positive integers other are poles (+inf),
input = 1 is +inf and input < 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])
>>> zeta(x, 1.0)
tensor([1.645, 1.202])