Opened 11 years ago
Closed 7 years ago
#8348 closed enhancement (fixed)
Document that find_root only works in fixed (double) precision
Reported by:  zimmerma  Owned by:  AlexGhitza 

Priority:  major  Milestone:  sage6.2 
Component:  basic arithmetic  Keywords:  
Cc:  was  Merged in:  
Authors:  Paul Zimmermann  Reviewers:  Marc Mezzarobba 
Report Upstream:  N/A  Work issues:  
Branch:  u/mmezzarobba/8348find_root_doc  Commit:  98bdbcc7f617ca2015b984e1b4f0412cc586fa99 
Dependencies:  Stopgaps: 
Description
How can one approximate the root of an equation in arbitrary precision? For example I want the root of log(x+2) = x to 50 digits of precision:
sage: (log(x+2)x).find_root(1,2) 1.1461932206205643 sage: (log(x+2)x).find_root(1,2,prec=150)  TypeError Traceback (most recent call last) /users/caramel/zimmerma/try/<ipython console> in <module>() /usr/local/sagecore2/local/lib/python2.6/sitepackages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.find_root (sage/symbolic/expression.cpp:24383)() TypeError: find_root() got an unexpected keyword argument 'prec'
Attachments (1)
Change History (10)
comment:1 Changed 11 years ago by
 Cc was added
comment:2 Changed 11 years ago by
 Type changed from defect to enhancement
comment:3 Changed 11 years ago by
This is about adding capability not currently present, so should be an enhancement.
I do not agree. The documentation does not say that find_root
only works in double precision,
thus this is a defect (at least of the documentation). Do you agree with that?
comment:4 Changed 11 years ago by
 Summary changed from find_root only works in fixed (double) precision to Document that find_root only works in fixed (double) precision
 Type changed from enhancement to defect
The docs for find_root don't imply that it uses arbitrary precision to me, so I agree it's an omission, but not a bug (i.e., it doesn't claim one thing and do another). The only mention of precision in the docs (in the xtol and rtol parameters) implies that things work with double precision.
But this is a minor point. I was trying to clean up the large number of tickets that are classified as "bugs" (which to me means things that Sage claims should work, but don't).
In this case, the error returned indicates that find_root knows nothing about a prec argument, which is appropriate.
I've switched it back so we don't waste any more time fretting about how to classify this ticket.
comment:5 Changed 8 years ago by
 Milestone changed from sage5.11 to sage5.12
Changed 8 years ago by
comment:6 followup: ↓ 7 Changed 8 years ago by
 Status changed from new to needs_review
 Type changed from defect to enhancement
the attached patch (produced against Sage 5.9) adds documentation to find_root
.
Note: I found out that find_root
is duplicated in numerical/optimize.py
and in symbolic/expression.pyx
, which is unfortunate.
Paul
comment:7 in reply to: ↑ 6 Changed 7 years ago by
 Branch set to u/mmezzarobba/8348find_root_doc
 Commit set to 98bdbcc7f617ca2015b984e1b4f0412cc586fa99
 Reviewers set to Marc Mezzarobba
 Status changed from needs_review to positive_review
LGTM.
Replying to zimmerma:
Note: I found out that
find_root
is duplicated innumerical/optimize.py
and insymbolic/expression.pyx
, which is unfortunate.
Only (part of) the documentation is duplicated; one of the function is a wrapper for the other. It is unfortunate indeed, but that's a problem that occurs everywhere in Sage, so I don't think it really makes sense to open a ticket for that particular instance.
New commits:
98bdbcc  #8348: Document that find_root only works in fixed (double) precision

comment:8 Changed 7 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:9 Changed 7 years ago by
 Resolution set to fixed
 Status changed from positive_review to closed
This is about adding capability not currently present, so should be an enhancement.