# evaluation of $\operatorname{Arg}\zeta (1/2+is)$ ??

how could evaluate with accuracy the function $\operatorname{arg} \zeta (1/2+is)$ here $\zeta (s)$ is the ‘Riemann Zeta function’ on the critical line

I had thought that I could use the ‘Riemann Siegel formula’ for

$$\zeta (1/2+ik)e^{i\theta (k)} \text{ with } \theta (k) = \left(\Im\log\Gamma (1/4+ik/2)\right)-(k/2)\log\pi$$

then I simply should take $\Im\log\zeta(1/2+ik)$ after the calculations of the Riemann Zeta function on the critical line.

#### Solutions Collecting From Web of "evaluation of $\operatorname{Arg}\zeta (1/2+is)$ ??"

(This is a response to a comment of the OP dated july 31 from my other answer and not to the main question)

Perhaps that this picture will make things clearer concerning the argument of $\zeta$ :

It represents $\ \frac 1{\pi}\rm{Arg}(\zeta(1/2+it))\ \$ ($-\frac 1{\pi}\theta(t)$ would produce the same curve but continuous with the discontinues pieces larger than $14$ shifted down $1, 2, 3,\cdots$ units)

Note that for every zero of $\ \zeta\left(\frac 12+it\right)$ (near $14.135,\ 21.022,\ 25.011,\cdots$) we get a jump of $1$ but this jump is not at a fixed value of the argument $\bmod{2\pi}$. This implies that the $N(t)$ ‘continuous zeros counting function’ in your link (not exactly the argument of $\zeta$ by the way) won’t have its fractional part exactly $0$ when crossing a zeta zero (i.e. $N(t)$ is used for the asymptotic proof using the argument principle so don’t take the decimals of this ‘number of zeros’ too seriously!).

The values of $t$ such that $\ \theta(t)=n\pi\$ (where $\zeta\left(\frac 12+it\right)$ will be real) are called the Gram points and the ‘Gram law’ is merely Gram’s numerical observation that the zeros of the $Z$-function seem to alternate with the Gram points (on the picture $g_0\approx 17.85,\ g_1\approx 23.17,\ g_2\approx 27.67,\cdots$).
(for more see Edwards’ book as well as some exceptions to the ‘law’)

To make a jump of $1$ exactly when crossing a zero we may use the method proposed in this link : subtract $-\theta(t)$ and $\rm{Arg}\left(\zeta\left(\frac 12+it\right)\right)$. This works because an $\rm{Arg}(z)$ function implementation will usually suppose that $z=r e^{i\phi}$ with $r\ge 0$ and $\phi$ in $(-\pi,\pi]$. So that when $z$ crosses $0$ the new small negative $r$ will be replaced by the positive $r=|Z(t)|$ and $\pi$ will be added/subtracted to the phase to take care of the change of sign. The phase will just change smoothly and furnish the ‘crossing angle’ at the origin where the fast radius modifications take as back as illustrated.

Orbit corresponding to $\zeta\left(\frac 12+it\right)$ in the complex plane :

I must add that the constraint $\phi \in (-\pi,\pi]$ and the possibility for $\theta(t)$ to be near $k\pi$ will sometimes revert the $\pi$ displacement (near $t=300$ and $1000$ if I remember well) but the error doesn’t seem to propagate…

I hope this will clarify more,

Let’s define two real functions $\theta$ and $\operatorname{Z}$ by :
$$\zeta\left(\frac 12+it\right)=e^{-i \theta(t)} \operatorname{Z}(t)$$

The $\theta$ function is named ‘Riemann–Siegel theta function’ (and shouldn’t be confused with the ‘Riemann–Siegel formula’ used for numerical evaluation of the previous ‘$\operatorname{Z}$ function’).

Then this $\theta$ function is directly minus the argument of $\zeta\left(\frac 12+it\right)$ as you hoped!

In the functional equation at $s=\dfrac 12 + i t\$ we may replace $\zeta\left(\frac 12\pm it\right)$ by $e^{-i \theta(\pm t)} \operatorname{Z}(\pm t)$ to get (with some work and using the fact that $\operatorname{Z}(t)$ is real so that $\operatorname{Z}(t)$= $\overline{\operatorname{Z}(t)}$) :

$$\theta(t)= \Im\left(\log\left(\Gamma\left(\frac 14+\frac{it}2\right)\right)\right) – \frac {\log(\pi)}2 t$$

The searched argument is simply $-\theta(t)= -\arg\left(\Gamma\left(\frac 14+\frac{it}2\right)\right) + \frac {\log(\pi)}2 t$.

The difficult part is really the $\operatorname{Z}$ function!