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

doctest fix for: substitute exp(-x) with x infinity fails #19918

Closed
videlec opened this issue Jan 20, 2016 · 33 comments
Closed

doctest fix for: substitute exp(-x) with x infinity fails #19918

videlec opened this issue Jan 20, 2016 · 33 comments

Comments

@videlec
Copy link
Contributor

videlec commented Jan 20, 2016

sage: exp(-Infinity)
0

is fine, but

sage: exp(-x).subs(x=Infinity)
Traceback (most recent call last):
...
RuntimeError: exp_eval(): exp^(unsigned_infinity) encountered 

Original report thread:

https://groups.google.com/forum/#!topic/sage-devel/tqDSbZ499ME

Depends on #19948

CC: @rwst

Component: symbolics

Keywords: bug

Author: Benjamin Hackl

Branch/Commit: 45420f5

Reviewer: Ralf Stephan

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

@videlec videlec added this to the sage-7.1 milestone Jan 20, 2016
@videlec

This comment has been minimized.

@jdemeyer
Copy link
Contributor

comment:2

This is very likely a bug in pynac.

@behackl
Copy link
Member

behackl commented Jan 20, 2016

comment:3

As far as I can tell, there is some sort of sign confusion occurring in pynac. This is now pynac/pynac#123.

@behackl
Copy link
Member

behackl commented Jan 20, 2016

Upstream: Reported upstream. Developers acknowledge bug.

@rwst
Copy link
Contributor

rwst commented Jan 21, 2016

comment:4

The reason is

sage: hash(SR(-oo))
2886518159
sage: hash((-x).subs(x=oo))
81231252
sage: hash((x).subs(x=-oo))
2886518159

See #19927 and #19928 for related bugs.

@behackl
Copy link
Member

behackl commented Jan 23, 2016

Dependencies: pynac-0.6.0

@behackl
Copy link
Member

behackl commented Jan 23, 2016

Changed upstream from Reported upstream. Developers acknowledge bug. to Fixed upstream, in a later stable release.

@behackl
Copy link
Member

behackl commented Jan 23, 2016

comment:5

This will be fixed in pynac-0.6.0; I'll add a doctest on this ticket after the upgrade.

@behackl
Copy link
Member

behackl commented Jan 23, 2016

Changed dependencies from pynac-0.6.0 to pynac-0.6.1

@behackl
Copy link
Member

behackl commented Jan 23, 2016

comment:6

Replying to @behackl:

This will be fixed in pynac-0.6.0; I'll add a doctest on this ticket after the upgrade.

... typo; I meant the next release (pynac-0.6.1 or so...).

@behackl
Copy link
Member

behackl commented Jan 25, 2016

New commits:

5c8814119448: update Pynac pkg data
b76a8ad19948: add stieltjes() interface; fix doctest
485740219949: fix type of error raised by stieltjes()
be7423badd doctest for exp (substitution with oo)
f2546c0add doctest for arctan (substitution with oo)

@behackl
Copy link
Member

behackl commented Jan 25, 2016

Changed dependencies from pynac-0.6.1 to #19948

@behackl
Copy link
Member

behackl commented Jan 25, 2016

Branch: u/behackl/symbolics/oo_subs

@behackl
Copy link
Member

behackl commented Jan 25, 2016

Commit: f2546c0

@behackl
Copy link
Member

behackl commented Jan 25, 2016

Changed commit from f2546c0 to a9719e7

@behackl
Copy link
Member

behackl commented Jan 25, 2016

New commits:

8a9b6acTrac #19948: Upgrade to pynac-0.6.1
bd1c11dadd doctest for exp (substitution with oo)
a9719e7add doctest for arctan (substitution with oo)

@behackl
Copy link
Member

behackl commented Jan 25, 2016

Changed branch from u/behackl/symbolics/oo_subs to u/behackl/symbolics/subs_oo

@jdemeyer
Copy link
Contributor

comment:9

I recommend adding a test also for [comment:4], which is the real underlying reason of this ticket.

@behackl
Copy link
Member

behackl commented Jan 26, 2016

comment:10

I agree. Where is the best place to add tests for the equality of these hashes? Probably in the __hash__-methods in rings/infinity.py introduced in #19927?

@rwst
Copy link
Contributor

rwst commented Jan 26, 2016

comment:11

Replying to @behackl:

I agree. Where is the best place to add tests for the equality of these hashes? Probably in the __hash__-methods in rings/infinity.py introduced in #19927?

No, this is SR-specific, so Expression.__hash__ would be the place.

@jdemeyer
Copy link
Contributor

comment:12

Indeed. There are already several doctests of the form hash(x) == hash(SR(x)) and that would fit there as well.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 26, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

00b7c17add doctest for equality of hashes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 26, 2016

Changed commit from a9719e7 to 00b7c17

@behackl
Copy link
Member

behackl commented Jan 26, 2016

comment:14

Thanks for pointing me there! I've added some tests for this; there might be some overlap with #19928. Do you want to have an explicit test like

sage: hash(x.subs(x=-oo)) == hash((-x).subs(x=oo))
True

too?

@rwst
Copy link
Contributor

rwst commented Jan 26, 2016

comment:15

What you added is fine already, thanks! I'll just wait for #19948 with the review.

@rwst
Copy link
Contributor

rwst commented Feb 5, 2016

Changed upstream from Fixed upstream, in a later stable release. to none

@rwst
Copy link
Contributor

rwst commented Feb 5, 2016

Reviewer: Ralf Stephan

@rwst
Copy link
Contributor

rwst commented Feb 5, 2016

Author: Benjamin Hackl

@rwst rwst changed the title substitute exp(-x) with x infinity fails doctest fix for: substitute exp(-x) with x infinity fails Feb 5, 2016
@rwst rwst modified the milestones: sage-7.1, sage-7.2 Feb 5, 2016
@vbraun
Copy link
Member

vbraun commented Feb 5, 2016

comment:17

doctest fails

@rwst
Copy link
Contributor

rwst commented Feb 6, 2016

Changed branch from u/behackl/symbolics/subs_oo to u/rws/symbolics/subs_oo

@rwst
Copy link
Contributor

rwst commented Feb 6, 2016

New commits:

aba1d30Merge branch 'develop' into t/19918/symbolics/subs_oo
45420f519918: fix typo

@rwst
Copy link
Contributor

rwst commented Feb 6, 2016

Changed commit from 00b7c17 to 45420f5

@vbraun
Copy link
Member

vbraun commented Feb 6, 2016

Changed branch from u/rws/symbolics/subs_oo to 45420f5

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

5 participants