Opened 6 years ago
Closed 6 years ago
#9891 closed defect (fixed)
substitute goes too far: (5-e^x).substitute(x=log(x)) -> 5-log(x)
Reported by: | burcin | Owned by: | burcin |
---|---|---|---|
Priority: | critical | Milestone: | sage-4.7.1 |
Component: | symbolics | Keywords: | pynac |
Cc: | rbk | Merged in: | sage-4.7.1.alpha1 |
Authors: | Richard Kreckel | Reviewers: | Karl-Dieter Crisman |
Report Upstream: | Fixed upstream, in a later stable release. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | #11317 | Stopgaps: |
Description
Reported by Kees on sage-support:
http://groups.google.com/group/sage-support/t/bfa34b077dd31b73
Running the following few lines: eq=5-e^x print "1:",eq.substitute(x=3*x) print "2:",eq.substitute(x=log(x)) yields the output (Sage 4.5.2 with Ubuntu): 1: -e^(3*x) + 5 2: -log(x) + 5
This is also present in GiNaC:
ginsh - GiNaC Interactive Shell (ginac V1.5.7) __, _______ Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, (__) * | Germany. This is free software with ABSOLUTELY NO WARRANTY. ._) i N a C | You are welcome to redistribute it under certain conditions. <-------------' For details type `warranty;'. Type ?? for a list of help topics. > subs(5-exp(x),x==log(x)); 5-log(x)
Attachments (1)
Change History (11)
comment:1 Changed 6 years ago by
- Cc kreckel@… added
- Report Upstream changed from Not yet reported upstream; Will do shortly. to Reported upstream. Developers acknowledge bug.
comment:2 Changed 6 years ago by
- Cc rbk added; kreckel@… removed
- Report Upstream changed from Reported upstream. Developers acknowledge bug. to Fixed upstream, in a later stable release.
- Status changed from new to needs_work
comment:3 Changed 6 years ago by
Burcin, I'm still getting
---------------------------------------------------------------------- | Sage Version 4.6.2.alpha4, Release Date: 2011-02-07 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- ********************************************************************** * * * Warning: this is a prerelease version, and it may be unstable. * * * ********************************************************************** sage: (5-e^x).substitute(x=log(x)) -log(x) + 5
Which version of Pynac is this in?
comment:4 Changed 6 years ago by
For reference, here is a link to the upstream patch: http://www.ginac.de/ginac.git?p=ginac.git;a=commitdiff;h=90ad10b58d02365a407b2d84d8b93e50030feaa5
comment:5 Changed 6 years ago by
I can confirm this is not in the latest version of Pynac in Sage or on its website (0.2.1), by looking at container.h.
comment:6 Changed 6 years ago by
- Dependencies set to 11317
- Status changed from needs_work to needs_review
New pynac package with the fix is at #11317.
comment:7 follow-up: ↓ 8 Changed 6 years ago by
- Reviewers set to Karl-Dieter Crisman
- Status changed from needs_review to positive_review
Okay, this is fine.
Burcin, I have to say I feel a little odd saying that I'm reviewing Kreckel's work, when I'm really reviewing your merging his work and your doctest (though I looked at the actual patch, naturally). Is there a different way to put the author in? You are the author of the actual patch here, not the Ginac update; I don't think any other spkgs put upstream people who committed things in this way.
comment:8 in reply to: ↑ 7 Changed 6 years ago by
Thanks for the review!
Replying to kcrisman:
Burcin, I have to say I feel a little odd saying that I'm reviewing Kreckel's work, when I'm really reviewing your merging his work and your doctest (though I looked at the actual patch, naturally). Is there a different way to put the author in? You are the author of the actual patch here, not the Ginac update; I don't think any other spkgs put upstream people who committed things in this way.
I put Richard's name in the authors list since he should get the credit for fixing this in the Sage release notes. I think we should give more credit to upstream developers. Are you suggesting my name should be in the authors or the reviewers field? :)
comment:9 Changed 6 years ago by
- Dependencies changed from 11317 to #11317
- Milestone changed from sage-4.7 to sage-4.7.1
comment:10 Changed 6 years ago by
- Merged in set to sage-4.7.1.alpha1
- Resolution set to fixed
- Status changed from positive_review to closed
This was fixed in GiNaC by Richard Kreckel:
http://www.ginac.de/pipermail/ginac-list/2010-September/001738.html
I merged his changes to pynac, so it will be available in the next release.