Opened 13 years ago
Closed 12 years ago
#6376 closed defect (duplicate)
serious bug in _maxima_init_ method for formal derivatives with new symbolics
Reported by: | was | Owned by: | burcin |
---|---|---|---|
Priority: | critical | Milestone: | sage-duplicate/invalid/wontfix |
Component: | calculus | Keywords: | |
Cc: | gmhossain, mhansen | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
sage: f(x) = function('f',x) sage: g = f(-x).diff(x); g -D[0](f)(-x) sage: g._maxima_init_() "(diff('f(x), x, 1))*(-1)"
Notice that the -x
inside f is totally ignored! This is because of code in the derivative method around line 454 of sage/symbolic/expression_conversion.py
Changing the line
args = ex.args()
to
args = ex.operands()
"fixes" the problem, in that a NotImplementedError? gets raised, instead of a wrong result returned. This is way better than the current situation, and we better fix this asap.
A better fix of course is to implement proper conversion. mhansen wrote this code, so maybe it would be easy for him.
Change History (6)
comment:1 Changed 13 years ago by
- Cc gmhossain added
comment:2 Changed 12 years ago by
- Cc mhansen added
comment:3 Changed 12 years ago by
fixed with patch at #7401 which waits for review.
sage: f(x) = function('f',x) sage: g = f(-x).diff(x); g -D[0](f)(-x) sage: g._maxima_init_() "(at(diff('f(dummy_var_der), dummy_var_der,1),dummy_var_der=-x))*(-1)"
comment:4 Changed 12 years ago by
- Status changed from new to needs_review
comment:5 Changed 12 years ago by
- Status changed from needs_review to positive_review
Okay, this seems okay.
To release manager: please close this as fixed once #6376 is merged.
comment:6 Changed 12 years ago by
- Milestone changed from sage-4.3 to sage-duplicate/invalid/wontfix
- Resolution set to duplicate
- Status changed from positive_review to closed
Mike, do you have any time to look at this?
Thanks.
Burcin