github.com/gopherd/gonum@v0.0.4/mathext/zeta.go (about) 1 // Copyright ©2016 The Gonum Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package mathext 6 7 import "github.com/gopherd/gonum/mathext/internal/cephes" 8 9 // Zeta computes the Riemann zeta function of two arguments. 10 // Zeta(x,q) = \sum_{k=0}^{\infty} (k+q)^{-x} 11 // Note that Zeta returns +Inf if x is 1 and will panic if x is less than 1, 12 // q is either zero or a negative integer, or q is negative and x is not an 13 // integer. 14 // 15 // See http://mathworld.wolfram.com/HurwitzZetaFunction.html 16 // or https://en.wikipedia.org/wiki/Multiple_zeta_function#Two_parameters_case 17 // for more detailed information. 18 func Zeta(x, q float64) float64 { 19 return cephes.Zeta(x, q) 20 }