Can I calculate the product over the primes efficiently and with high precision? I want to calculate the following product : $$\prod_{p\ prime\ ,\ p\le 10^{10}} 1-\frac{1}{p}$$

I know the approximation formula $$\frac{e^{-\gamma}}{\ln(10^{10})}$$ where $\gamma$ is the Euler-Mascheroni-constant. The result should be good to $12$ decimal digits.


  Is there an efficient way (not brute force by determining all primes, which takes long with PARI/GP) to calculate this product with high precision ?
Call the product $P$, and take logs to get $\log(P)=\sum_{i=1}^n\log(1-1/p_i)=-\sum_{i=1}^n\frac{1}{p_i}-\frac{1}{2}\sum_{i=1}^n\frac{1}{p^2_i}+...\approx-\sum_{i=1}^n\frac{1}{p_i}-\gamma$

So to get a good approximation, use ever-better approximations of $\sum_{i=1}^n\frac{1}{p_i}$. As an example, the Meissel Merten constant is defined as $M:=\lim_{n\rightarrow\infty}\sum_{i=1}^n1/p_i-\ln\ln(n)\approx 0.26149$.

If you're still getting error, you can look into the error for finite sum approximations of $\gamma=\sum_{m=2}^\infty (-1)^m\frac{\zeta(m)}{m}$.
Call the product $P$, and take logs to get $\log(P)=\sum_{i=1}^n\log(1-1/p_i)=-\sum_{i=1}^n\frac{1}{p_i}-\frac{1}{2}\sum_{i=1}^n\frac{1}{p^2_i}+...\approx-\sum_{i=1}^n\frac{1}{p_i}-\gamma$

So to get a good approximation, use ever-better approximations of $\sum_{i=1}^n\frac{1}{p_i}$. As an example, the Meissel Merten constant is defined as $M:=\lim_{n\rightarrow\infty}\sum_{i=1}^n1/p_i-\ln\ln(n)\approx 0.26149$.

If you're still getting error, you can look into the error for finite sum approximations of $\gamma=\sum_{m=2}^\infty (-1)^m\frac{\zeta(m)}{m}$.