I discovered some strange behaviour of the PolyLog[] Function in Mathematica which seems to me like a bug in the function implementation.

It looks like PolyLog is breaking down for big arguments and non-integer orders

In[1]:=  -PolyLog[5/2, -E^500] // N
Out[1]:= 2.691151407447062*10^8626 + 9.87331945684138*10^8623 I

which is for sure incorrect. For such big arguments the PolyLog function has nice asymptotic approximations (which are e.g. used for complete Fermi-Dirac Integrals which are related to PolyLog's) through $F_n(x)=-\mathrm{Li}_{n+1}(-e^x)$.

This can be demonstrated by using even orders for the PolyLog[] with similar big arguments

In[2]:=  -PolyLog[4, -E^500] // N
Out[2]:= 2.60437*10^9

if compared to the asymptotic approximation $\frac{u^n}{\Gamma(n+1)}$ of $-\mathrm{Li}_n(-e^u)$

In[3]:=  u^4/Gamma[5] /. u->500 //N
Out[3]:= 2.60417*10^9

the results look o.k.

The expected result of above given argument E^500 and order 5/2 should be

In[4]:=  u^(5/2)/Gamma[5/2 + 1] /. u -> 500 // N
Out[4]:= 1.68209*10^6

I assume that the function algorithm somehow gets troubles with internal accuracy. Any ideas to "tell" Mathematica to increase the accuracy for the numerical calculation?


1 Answer 1


Is the following a better result? (I'm not an expert.)

Block[{$MaxExtraPrecision = 100},
  N[-PolyLog[5/2, -E^500], 20]

(* Out: 1.6821298518320559359*10^6 + 0.*10^-14 I *)
  • $\begingroup$ Yes this is a better result - see update of question above. Thanks for the proposal. This leaves the question why Mathematica is not able to calculate the correct result in first place with the default accuracy. $\endgroup$
    – Rainer
    Mar 29, 2013 at 23:24
  • 1
    $\begingroup$ @Rainer Again, I'm not an expert on PolyLogs specifically, but this is a common issue in special function evaluation. I certainly wouldn't trust the result of N[Sin[E^500]], I would be more comfortable with N[Sin[E^500], 20], after increasing $MaxExtraPrecision to 400 or so. $\endgroup$ Mar 29, 2013 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.