#17237: Consistent complex arguments for log integral
-------------------------------------------------+-------------------------
       Reporter:  kcrisman                       |        Owner:
           Type:  defect                         |       Status:  new
       Priority:  major                          |    Milestone:  sage-6.4
      Component:  basic arithmetic               |   Resolution:
       Keywords:                                 |    Merged in:
        Authors:                                 |    Reviewers:
Report Upstream:  Reported upstream. Developers  |  Work issues:
  acknowledge bug.                               |       Commit:
         Branch:                                 |     Stopgaps:
   Dependencies:                                 |
-------------------------------------------------+-------------------------

Comment (by kcrisman):

 Some thoughts from FJ:
 > Here is a possible solution that seems to work off the real line (but
 > I haven't checked all corner cases). You can basically write the
 > asymptotic expansion of li as a 2F0 plus an ugly branch correction
 > term
 (http://functions.wolfram.com/GammaBetaErf/LogIntegral/06/02/0003/).
 > Removing most of the ugly branch correction term should do the trick.
 > The 2F0 diverges, but mpmath can normalize it.
 {{{
 def li1(z):
     return quad(lambda t: 1/ln(t), [2, z]) + li(2)

 def li2(z):
     return z * hyp2f0(1,1,1/log(z))/log(z) + pi * sign(im(z)) * 1j
 }}}
 > The outputs seem to agree:
 {{{
 mp.dps = 30

 for n in range(30):
     z=30*(rand()-0.5)+30*(rand()-0.5)*1j
     print z, chop(li1(z) - li2(z))
 }}}
 > (You get some large differences, but they appear to be due to the
 > numerical integration.)
 > I don't think this is the best way to compute the function, but it
 > might be *a* way. It needs to be checked to make sure it's actually
 > correct, of course.

--
Ticket URL: <http://trac.sagemath.org/ticket/17237#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to