Opened 4 years ago

Closed 2 years ago

#19906 closed defect (wontfix)

Doctest fix for: dilog(RR) should return an element of RR

Reported by: zimmerma Owned by:
Priority: minor Milestone: sage-duplicate/invalid/wontfix
Component: basic arithmetic Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Reported upstream. Developers acknowledge bug. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by rws)

in Sage 6.10:

sage: dilog(-1.0)
-1/12*pi^2
sage: dilog(1)
1/6*pi^2
sage: dilog(0.5)
1/12*pi^2 - 1/2*log(2)^2

we should not get symbolic output with floating-point input.

Reported as https://github.com/pynac/pynac/issues/219

Change History (13)

comment:1 Changed 3 years ago by rws

  • Description modified (diff)
  • Report Upstream changed from N/A to Reported upstream. Developers acknowledge bug.

comment:2 Changed 3 years ago by rws

  • Branch set to u/rws/dilog_rr__should_return_an_element_of_rr

comment:3 Changed 3 years ago by rws

  • Commit set to 896bdc714d486dedda490f5949afd261bcb25ca3
  • Dependencies set to pynac-0.7.2
  • Status changed from new to needs_review
  • Summary changed from dilog(RR) should return an element of RR to Doctest fix for: dilog(RR) should return an element of RR

This is fixed in Pynac git master. This ticket has doctests but they depend on a pynac-0.7.2 upgade.


New commits:

896bdc719906: doctest fix for: dilog(RR) should return an element of RR

comment:4 Changed 3 years ago by rws

  • Dependencies changed from pynac-0.7.2 to #21963

comment:5 Changed 3 years ago by vdelecroix

You need to set your name in the Authors field.

comment:6 Changed 3 years ago by vdelecroix

Could you be more careful and actually check the parent of the output? In other words something like

sage: y = dilog( RealField(13)(1.0))
sage: assert parent(y) is RealField(13)
sage: y = dilog( RealField(100)(1.0))
sage: assert parent(y) is RealField(100)

I don't know to which extent this function is available on intervals, balls and complexes but they should be tested as well with various precision.

comment:7 Changed 3 years ago by rws

  • Status changed from needs_review to needs_work

comment:8 Changed 3 years ago by rws

  • Branch changed from u/rws/dilog_rr__should_return_an_element_of_rr to u/rws/19906

comment:9 Changed 3 years ago by rws

  • Commit changed from 896bdc714d486dedda490f5949afd261bcb25ca3 to 4f451a479be21b5eeac4ca4dccf934203f5a4166

Note also

sage: polylog(3,RBF(1.1))      # there is a polylog RBF member!
1.37625299668538 - 0.0142691615444952*I
sage: dilog(RBF(1.1))
1.96199910130557 - 0.299425760685590*I

New commits:

4f451a419906: doctest fix for: dilog(RR) should return an element of RR

comment:10 follow-up: Changed 3 years ago by zimmerma

For me, the last commit 4f451a4 fixes the issue raised in comment 6. We could proceed and give a positive review. (The case of intervals, balls and complexes can be dealt with in a different ticket.)

Paul

comment:11 in reply to: ↑ 10 Changed 3 years ago by rws

  • Branch u/rws/19906 deleted
  • Commit 4f451a479be21b5eeac4ca4dccf934203f5a4166 deleted
  • Dependencies #21963 deleted
  • Milestone changed from sage-7.0 to sage-duplicate/invalid/wontfix
  • Status changed from needs_work to positive_review

Replying to zimmerma:

For me, the last commit 4f451a4 fixes the issue raised in comment 6. We could proceed and give a positive review. (The case of intervals, balls and complexes can be dealt with in a different ticket.)

No, actually the given doctest fails (that's why I didn't set needs review). But the notion that dilog(RealField(13)(1.0)) should return anything real I commented on in https://trac.sagemath.org/ticket/18386#comment:8. More obviously, demanding that dilog(RealField(13)(1.1)) should have RealField(13) as parent is a red herring because the result just is complex.

However, there are still issues with polylog (and thus dilog) , I just reopened https://github.com/pynac/pynac/issues/219 to fix them. I believe #18386 is more fitting to be the ticket to add a doctest once it's fixed so I propose to make this a duplicate. As you seem to be of similar attitude I take the liberty to set positive all at once.

comment:12 Changed 3 years ago by zimmerma

since the initial issue in the description of this ticket is now fixed (here with Sage 7.6):

sage: dilog(-1.0)
-0.822467033424113
sage: dilog(0.5)
0.582240526465012

I would simply add those two tests in the doctests, maybe with one test checking the parent:

sage: y = dilog(RealField(13)(0.5))
sage: parent(y)
Real Field with 13 bits of precision

and indeed defer to #18386 the other issues (branch point, complex values).

comment:13 Changed 2 years ago by embray

  • Resolution set to wontfix
  • Status changed from positive_review to closed

Closing tickets in the sage-duplicate/invalid/wontfix module with positive_review (i.e. someone has confirmed they should be closed).

Note: See TracTickets for help on using tickets.