I'm trying to implement a function to calculate $\pi(x)$ via Riemann's formula: $$ \pi(x) = \operatorname{R}(x^1) - \sum_{\rho}\operatorname{R}(x^{\rho}) - \frac1{\ln x} + \frac1\pi \arctan \frac\pi{\ln x} , $$ with $ \operatorname{R}(x) = \sum_{n=1}^{\infty} \frac{ \mu (n)}{n} \operatorname{li}(x^{1/n})$, the sum runs over the non-trivial roots of $\zeta$ and $\text{li}(z)$ being the logarithmic integral.
The problem is that I don't have function to calculate $\text{li}(z)$. Since I'm not familiar with complex limits I'm not sure if I can write it as a simple sum.
Thanks for your help,
BTW, my result for $x=100,n_{max}=1$ and only one root of $\zeta$ is $30.2748$. Can anyone crosscheck that?
Ok I found this very nice paper:
They put pseudocodes for all approximations there, which are really close to an implementation.