I have recently read "The music of the primes" by Marcus du Sautoy (see excerpt here >>>). There he writes:
"So how fair are the prime number dice? Mathematicians call a dice "fair" if the difference between the theoretical behaviour of the dice and the actual behaviour after $N$ tosses is within the region of the square root of $N$. The heights of Riemann's harmonics are given by the east-west coordinate of the corresponding point at sea-level. If the east-west coordinate is $c$ then the height of the wave grows like $N^c$. This means the contribution from this harmonic to the error between Gauss's guess and the real number of primes will be $N^c$. So if the Riemann Hypothesis is correct and $c$ is always $1/2$, the error will always be $N^{1/2}$ (which is just another way of writing the square root of $N$). If true, the Riemann Hypothesis means that Nature's prime number dice are fair, never straying more than the square root of $N$ from Gauss's theoretical prime number dice."
However, we know from Helge von Koch (1901)[2] that if the Rieman Hypothesis true, then: $$\pi(x)=Li(x)+\mathcal O(\sqrt x \log x)$$ where $\pi(x)$ prime counting function and $Li(x)$ according Gauss.
My question:
Is what Sautoy says correct? Is the error indeed $(\sqrt x \log x)$ or as Sautoy states $\sqrt x$? Or did I misunderstand something?
[2]: Von Koch, Helge (1901). "Sur la distribution des nombres premiers" (On the distribution of prime numbers). Acta Mathematica (in French). 24 (1): 159–182.
The statement of du Sautoy is indeed slightly imprecise as the error term is known to be slightly worse than $O( \sqrt{x})$.
But as you said, it is close to the truth, and the added complexity for a precise statement seems not worth it in that context.
To be clear it is known that (see below for details) $$\pi(x)-\operatorname{Li}(x) \ne O(\sqrt{x})$$
However, du Sautoy only gives a vague description of the situation, and one should not try to transcribe this literally and expect it to be true exactly. But the error-term is roughly $\sqrt{x}$, and to say this is the point of the description. (In fact, I believe, but would have to check to be sure, that also the deviations in a random walk given by a dice are not literally bounded by square-root.)
Note though that the result you recall does not prove that the claim is imprecise. There could be still better error-terms under RH, indeed there are better error-terms under RH, but they cannot be literally as good as du Sautoy says.
Let me add that the classical reference showing that the statement is imprecise is due to Littlewood ("Sur la distribution des nombres premiers." CRAS 1914), who show that the error term is $\Omega_{\pm}(\sqrt{x} \log \log \log x)$. That is there is a positive constant $c$ such that the error-term is larger than $c\sqrt{x} \log \log \log x$ for arbitrarily large $x$; and also a negative constant $c'$ such that it is smaller than $-c\sqrt{x} \log \log \log x$ for arbitrarily large $x$.
That is the error term oscillates and the amplitude is at least of order $\sqrt{x} \log \log \log x$.