Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections to infinities returned by mpmath #19439

Closed
rwst opened this issue Oct 20, 2015 · 16 comments
Closed

Corrections to infinities returned by mpmath #19439

rwst opened this issue Oct 20, 2015 · 16 comments

Comments

@rwst
Copy link
Contributor

rwst commented Oct 20, 2015

It seems in some cases the infinities returned from mpmath need to be changed by the function's evalf() in order to be correct:
Before:

sage: zeta(SR(1))
Infinity
sage: zeta(SR(1.))   <---------
+infinity
sage: type(zeta(SR(1)))
<type 'sage.symbolic.expression.Expression'>
sage: type(zeta(SR(1)).pyobject())
<class 'sage.rings.infinity.UnsignedInfinity'>
sage: type(zeta(SR(1.)))
<type 'sage.symbolic.expression.Expression'>
sage: type(zeta(SR(1.)).pyobject())
<type 'sage.rings.real_mpfr.RealNumber'>

The ticket should result in:

sage: zeta(SR(1))
Infinity
sage: zeta(SR(1.))
Infinity
sage: type(zeta(SR(1)))
<type 'sage.symbolic.expression.Expression'>
sage: type(zeta(SR(1)).pyobject())
<class 'sage.rings.infinity.UnsignedInfinity'>
sage: type(zeta(SR(1.)))
<type 'sage.symbolic.expression.Expression'>
sage: type(zeta(SR(1.)).pyobject())
<class 'sage.rings.infinity.UnsignedInfinity'>

Ideally, fix other such cases too in this ticket.

Depends on #22838

CC: @paulmasson

Component: symbolics

Author: Ralf Stephan

Branch/Commit: 5d2d860

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/19439

@rwst rwst added this to the sage-6.10 milestone Oct 20, 2015
@rwst
Copy link
Contributor Author

rwst commented Jun 11, 2016

comment:1

Polylog uses zeta here, so it's mainly because of RR(1).zeta() not being converted in symbolic/function.pyx or the RR functions not using the InfinityRing elements.

@rwst

This comment has been minimized.

@rwst
Copy link
Contributor Author

rwst commented Jul 19, 2016

comment:2

The problematic output is rather for the last lines, ie symbolic input, which should produce symbolic output. It does, by wrapping FP infinity into SR. It would be better if that would rather produce the infinity from the ring.

@rwst rwst modified the milestones: sage-6.10, sage-7.3 Jul 19, 2016
@paulmasson

This comment has been minimized.

@rwst

This comment has been minimized.

@rwst rwst changed the title Different infinities returned by zeta/polylog Convert FP subpackage infinities and NaNs to ring inifinities and symbolic NaN Aug 17, 2016
@rwst rwst modified the milestones: sage-7.3, sage-7.4 Aug 17, 2016
@rwst

This comment has been minimized.

@rwst

This comment has been minimized.

@rwst rwst modified the milestones: sage-7.4, sage-8.0 Apr 18, 2017
@rwst rwst changed the title Convert FP subpackage infinities and NaNs to ring inifinities and symbolic NaN Corrections to infinities returned by mpmath Apr 18, 2017
@rwst
Copy link
Contributor Author

rwst commented Apr 19, 2017

@rwst
Copy link
Contributor Author

rwst commented Apr 19, 2017

New commits:

5d2d86019439: Corrections to infinities returned by mpmath

@rwst
Copy link
Contributor Author

rwst commented Apr 19, 2017

Author: Ralf Stephan

@rwst
Copy link
Contributor Author

rwst commented Apr 19, 2017

Dependencies: pynac-0.7.6

@rwst
Copy link
Contributor Author

rwst commented Apr 19, 2017

Commit: 5d2d860

@rwst
Copy link
Contributor Author

rwst commented Apr 20, 2017

Changed dependencies from pynac-0.7.6 to #22838

@tscrim
Copy link
Collaborator

tscrim commented Apr 20, 2017

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Apr 20, 2017

comment:12

LGTM.

@vbraun
Copy link
Member

vbraun commented Apr 28, 2017

Changed branch from u/rws/corrections_to_infinities_returned_by_mpmath to 5d2d860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants