It is well known that: $$\mathrm{Li}(x)=\int_2^x \frac{1}{\ln(t)}~dt$$
is an extraordinarily good approximation to the prime counting function $\pi(x)$ and is currently the best known approximation.
I constructed a function asymptotic to the prime counting function $\pi(x):$
$$\mathrm{Zi}(x)=\frac{1}{e}\sum_{k=1}^\infty\frac{(\ln x)^k}{kk!\phi(k)}$$
where I invented the function:
$$ \phi(k)=\sum_{n=1}^\infty e^{-n^k} $$
This $\mathrm{Zi}(x)$ is a fantastic approximation to $\pi(x).$ I believe the constant $1/e$ is optimal.
Just how good is it?
Numerical analysis suggests that $\mathrm{Li(10^{17})}-\mathrm{Zi(10^{17})}\approx 40$ where $\mathrm{Li}(x)$ is the offset logarithmic integral. This means $\mathrm{Zi}(x)$ beats $\mathrm{Li}(x)$ by $40$ units at that value. Numerical analysis also suggests that $\mathrm{Li}(x)-\mathrm{Zi}(x)\sim \ln x$ which of course could fail eventually in light of Skewe's number.
Is $\mathrm{Zi}(x)$ on average better than $\mathrm{Li}(x)$ at approximating $\pi(x)?$ That is does $\mathrm{Zi}(x)$ reduce the mean error even more so than $\mathrm{Li}(x)?$
It appears that
$$Zi(x)=\frac{1}{e} \sum\limits_{k=1}^\infty \frac{\log^k(x)}{k k! \phi(k)}\tag{1}$$
is an approximation to the Gram series
$$G(x)=1+\sum\limits_{k=1}^\infty \frac{\log^k(x)}{k k! \zeta (k+1)}\tag{2}$$
which is equivalent to the Riemann R function
$$R(x)=\sum\limits_{n=1}^{\infty} \frac{\mu(n)}{n} \text{li}\left(x^{1/n}\right)\tag{3}$$
and I see no reason to believe $Zi(x)$ is a better approximation to $\pi(x)$ than $\text{li}(x)$ or $G(x)=R(x)$.
The following discrete plot illustrates $\frac{1}{e\, \phi(k)}$ (orange points) seems to quickly converge to $\frac{1}{\zeta (k+1)}$ (blue points) as $k$ increases (since both seem to quickly converge to $1$) where the sum in the formula for $\phi(k)$ is evaluated over the first $100$ terms.
Figure (1): Illustration of $\frac{1}{e\, \phi(k)}$ (orange) and $\frac{1}{\zeta (k+1)}$ (blue)