import math
from scipy.integrate import quad
def integrand(x):
return 1/math.log(x)
for i in range(1,13):
n = 10**i
I = quad(integrand, 1.45137, n)
print('Li(',n,') = ' ,I[0], ' Error bound = ', I[1], sep = "")
In evaluating the logarithmic integral function the code above returns values with sufficient accuracy for n up to 1,000,000, then accuracy deteriorates. For my requirement I would wish to keep the error bound well below 1 even for much larger arguments, say up to 10**12. I experimented with the epsabs and limit parameters, without any visible effect for any n, and since this is not a situation where the function values fall below the floating point lower limit I did not think it worthwhile trying my luck with multi-precision shenanigans. Any tips anyone?