Prime number theorem in an arithmetic progression with an exceptional zero (source code)

= Prime number theorem in an arithmetic progression with an exceptional zero

Uniformly for $x\geq2$, positive <integer> modulus $q$, and $\gcd(a,q)=1$,
$$
\psi(x;q,a)
=\frac{x}{\varphi(q)}
-\frac{\chi_1(a)x^\beta}{\beta\varphi(q)}
+O\left(
x(\log(2q))^2
\exp\left[-\frac{c\log x}{\log(2q)+\sqrt{\log x}}\right]
\right),
$$
where the second term occurs only when a real character $\chi_1$ has an <exceptional zero> $\beta$.

The term involving $\chi_1$ is omitted if there is no <exceptional zero>. Using $\log(2q)$ keeps the error meaningful at $q=1$, where the statement reduces to the ordinary <Prime number theorem> error rather than falsely asserting an exact equality.