Copyright | (c) 2016 Andrew Lelechenko |
---|---|
License | MIT |
Maintainer | Andrew Lelechenko <andrew.lelechenko@gmail.com> |
Safe Haskell | Safe |
Language | Haskell2010 |
Riemann zeta-function.
Documentation
zetas :: (Floating a, Ord a) => a -> [a] Source #
Infinite sequence of approximate (up to given precision)
values of Riemann zeta-function at integer arguments, starting with ζ(0)
.
Computations for odd arguments were formerly performed in accordance to
Computational strategies for the Riemann zeta function
by J. M. Borwein, D. M. Bradley, R. E. Crandall, formula (57), but now use
the zetaHurwitz
recurrence.
>>>
take 5 (zetas 1e-14) :: [Double]
[-0.5,Infinity,1.6449340668482264,1.2020569031595942,1.0823232337111381]
Beware to force evaluation of zetas !! 1
if the type a
does not support infinite values
(for instance, Fixed
).
zetasEven :: [ExactPi] Source #
Infinite sequence of exact values of Riemann zeta-function at even arguments, starting with ζ(0)
.
Note that due to numerical errors conversion to Double
may return values below 1:
>>>
approximateValue (zetasEven !! 25) :: Double
0.9999999999999996
Use your favorite type for long-precision arithmetic. For instance, Fixed
works fine:
>>>
import Data.Number.Fixed
>>>
approximateValue (zetasEven !! 25) :: Fixed Prec50
1.00000000000000088817842111574532859293035196051773