The mathIT Library
A Java™ API for mathematics
org.mathIT.numbers

## Class Riemann

• public class Riemann
extends Object
This class provides the Riemann zeta function ζ(s) for any complex number s and the Riemann-Siegel functions Z and θ.
Version:
2.01
Author:
Andreas de Vries
• ### Field Summary

Fields
Modifier and Type Field and Description
static double EPSILON
The predefined accuracy up to which infinite sums are approximated.
• ### Method Summary

All Methods
Modifier and Type Method and Description
static double[] chi(double[] s)
Returns the value χ(s) for a complex number s, such that ζ(s) = χ(s) ζ(1 - s).
static double theta(double t)
Riemann-Siegel theta function.
static double Z(double t)
Riemann-Siegel Z-function Z(t).
static double[] zeta(double[] s)
Riemann zeta function ζ(s) for s.
• ### Field Detail

• #### EPSILON

public static final double EPSILON
The predefined accuracy up to which infinite sums are approximated.
zeta(double[]), Constant Field Values
• ### Method Detail

• #### chi

public static double[] chi(double[] s)
Returns the value χ(s) for a complex number s, such that ζ(s) = χ(s) ζ(1 - s). It is defined as
χ(s)   =   2s πs - 1 sin(s π/2) Γ(1 - s)   =   πs - 1/2  Γ((1 - s)/2) Γ(s/2)

We have χ(s) χ(1 - s) = 1. [Eqs. (2.1.10)-(2.1.12) in E.C. Titchmarsh: The Theory of the Riemann Zeta-function. 2nd Edition, Oxford University Press, Oxford 1986], https://books.google.com/books?id=1CyfApMt8JYC&pg=PA16

Moreover χ is related to the Riemann-Siegel theta function θ by the equation

χ(½ + it) = e-2iθ(t),

see E.C. Titchmarsh: The Theory of the Riemann Zeta-function. 2nd Edition, Oxford University Press, Oxford 1986, p. 89 https://books.google.com/books?id=1CyfApMt8JYC&pg=PA89.

Parameters:
s - a complex value
Returns:
χ(s)
zeta(double[]), theta(double), Complex.gamma(double[])
• #### zeta

public static double[] zeta(double[] s)
Riemann zeta function ζ(s) for s. It is computed by
ζ(s)   =    1 1 - 21 - s
 ∞ Σ n=1
 (-1)n - 1 ns
if Re s > 0,

ζ(s)   =    1 1 - 21 - s
 ∞ Σ n=1
 1 2n + 1
 n Σ k=0
(-1)k (  n k
) (k + 1)-s
otherwise.

However, in this method the algorithm is used which is documented as “Algorithm 1” in Borwein et al, The Riemann Hypothesis, Springer, Berlin 2008, p 35 (https://books.google.com/books?id=Qm1aZA-UwX4C&pg=PA35)

The functions ζ, Z and θ are related by the equality Z(t) = ei θ(t) ζ(½ + it). Cf. H.M. Edwards: Riemann's Zeta Function. Academic Press, New York 1974, §6.5 (https://books.google.de/books?id=ruVmGFPwNhQC&pg=PA119).

Parameters:
s - the argument
Returns:
the zeta function value ζ(s)
Z(double), theta(double)
• #### Z

public static double Z(double t)
Riemann-Siegel Z-function Z(t). It is determined by the formula
Z(t)   =   2  m Σ n=1
 cos[θ(t) - t ln n] √n
+ O(|t|-1/4).

where

m   =   m(t)   =    |t| 2 π

and θ denotes the Riemann-Siegel theta function.

The functions ζ, Z and θ are related by the equality Z(t) = ei θ(t) ζ(½ + it). Cf. H.M. Edwards: Riemann's Zeta Function. Academic Press, New York 1974, §6.5 (https://books.google.de/books?id=ruVmGFPwNhQC&pg=PA119).

Parameters:
t - value on the critical line s = ½ + it.
Returns:
Z(t)
zeta(double[]), theta(double)
• #### theta

public static double theta(double t)
Riemann-Siegel theta function. In this method the value theta(t) is approximated using the Stirling series
θ(t)   =    t 2
ln  t 2 π
-    t 2
-    π 8
+    1 48t
+  7 5760 t3
+  31 80640 t5
+  127 430080 t7
+ R(t)     with |R(t)| <  1 t9

The functions ζ, Z and θ are related by the equality Z(t) = ei θ(t) ζ(½ + it). Cf. H.M. Edwards: Riemann's Zeta Function. Academic Press, New York 1974, §6.5 (https://books.google.de/books?id=ruVmGFPwNhQC&pg=PA119).

Parameters:
t - value on the critical line s = ½ + it.
Returns:
θ(t)