#18386: fix polylog evalf
-------------------------------------------------+-------------------------
       Reporter:  rws                            |        Owner:
           Type:  defect                         |       Status:  new
       Priority:  major                          |    Milestone:  sage-7.3
      Component:  symbolics                      |   Resolution:
       Keywords:  pynac special                  |    Merged in:
        Authors:                                 |    Reviewers:
Report Upstream:  Reported upstream. Developers  |  Work issues:
  acknowledge bug.                               |       Commit:
         Branch:                                 |     Stopgaps:
   Dependencies:                                 |
-------------------------------------------------+-------------------------
Changes (by rws):

 * milestone:  sage-6.8 => sage-7.3


Old description:

> The `polylog` function (from Pynac) treats `1.0` like `1` and does not
> immediately `evalf` with some numeric arguments.
> {{{
> sage: polylog(2,1)
> 1/6*pi^2
> sage: polylog(2.,1)
> 1.64493406684823
> sage: polylog(2,1.0)
> 1/6*pi^2
> sage: polylog(2,0.9)
> polylog(2, 0.900000000000000)
> sage: _.n()
> TypeError: cannot evaluate symbolic expression numerically
> }}}
> What makes `polylog` different is that the Sage `polylog` has no special
> value logic and calls Pynac's `Li_eval` for everything. This handles
> special values (incorrectly if an arg is FP) and sends everything else
> back with `.hold()`. So you need `N()` to get FP results that are not
> special. With FP  Pynac is called which then calls Sage/mpmath. But this
> then bombs with FP args.
>
> It seems better to simply implement everything in Sage because only the
> special value logic is still in Pynac, and buggy too.
>
> Consequently, `polylog` should be removed from the Pynac function
> registry.

New description:

 The `polylog` function (from Pynac) treats `1.0` like `1` and does not
 immediately `evalf` with some numeric arguments.
 {{{
 sage: polylog(2,1)
 1/6*pi^2
 sage: polylog(2.,1)
 1.64493406684823
 sage: polylog(2,1.0)
 1/6*pi^2
 sage: polylog(2,0.9)
 polylog(2, 0.900000000000000)
 sage: _.n()
 TypeError: cannot evaluate symbolic expression numerically
 }}}
 What makes `polylog` different is that the Sage `polylog` has no special
 value logic and calls Pynac's `Li_eval` for everything. This handles
 special values (incorrectly if an arg is FP) and sends everything else
 back with `.hold()`. So you need `N()` to get FP results that are not
 special. With FP  Pynac is called which then calls Sage/mpmath. But this
 then bombs with FP args.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/18386#comment:3>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to