  This paper uses concepts introduced by Fiorilli and Martin to develop a more
accurate remainder term in calculations of the distribution of primes in
residue classes. Using it in Rubinstein and Sarnak's method estimates the
limiting logarithmic frequency of pi(x)>Li(x) as 0.00000026300 with only 5 zeta
zeros used explicitly, and a reliable value between 0.000000262996732 and
0.000000262996733 is obtained with fewer than 100 zeros. Accurate results for
"prime number races" can usually be obtained with explicit use of only the
first zero of each L-function involved, thus bringing out their dependence on
those zeros. For extreme deviations, the method of steepest descent can be
applied, and the remainder approximated by an explicit formula together with a
rapidly convergent series. This gives, for example, 8.649*10^(-12477) for the
logarithmic frequency of pi(x)>Li(x)+5*Li(sqrt(x)). The Monach - Lamzouri model
of the extreme distribution is developed to give close agreement with these
results. The remainder can also be calculated explicitly as an asymptotic
series. This allows good modelling of non-extreme races and the calculation of
distributions by direct convolution. The three different methods agree to
within 0.001% where they overlap in application. The distribution calculated
from values of pi(x) for x<10^20 shows similar behaviour to the limiting
distribution, but is somewhat further from normal.
