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

Document that find_root only works in fixed (double) precision #8348

Closed
zimmermann6 opened this issue Feb 24, 2010 · 9 comments
Closed

Document that find_root only works in fixed (double) precision #8348

zimmermann6 opened this issue Feb 24, 2010 · 9 comments

Comments

@zimmermann6
Copy link

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/sage-core2/local/lib/python2.6/site-packages/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'

CC: @williamstein

Component: basic arithmetic

Author: Paul Zimmermann

Branch/Commit: u/mmezzarobba/8348-find_root_doc @ 98bdbcc

Reviewer: Marc Mezzarobba

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

@jasongrout
Copy link
Member

comment:2

This is about adding capability not currently present, so should be an enhancement.

@zimmermann6
Copy link
Author

comment:3

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?

@jasongrout
Copy link
Member

comment:4

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.

@jasongrout jasongrout changed the title find_root only works in fixed (double) precision Document that find_root only works in fixed (double) precision Mar 17, 2010
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@zimmermann6
Copy link
Author

Author: Paul Zimmermann

@zimmermann6
Copy link
Author

comment:6

Attachment: trac_8348.patch.gz

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

@mezzarobba
Copy link
Member

Branch: u/mmezzarobba/8348-find_root_doc

@mezzarobba
Copy link
Member

Reviewer: Marc Mezzarobba

@mezzarobba
Copy link
Member

comment:7

LGTM.

Replying to @zimmermann6:

Note: I found out that find_root is duplicated in numerical/optimize.py and in symbolic/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

@mezzarobba
Copy link
Member

Commit: 98bdbcc

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

6 participants