Issue 3428:  tolerance keyword of nsimplify is ignored  
2 people starred this issue and may be notified of changes.  Back to list 
Restricted
Sign in to add a comment

In [39]: print nsimplify(0.5*x**2  3.333333*x, tolerance=0.001, rational=True) x**2/2  3333333*x/1000000 I would have expected a smaller fraction on the x term (no more than 1000 in the denominator).
Oct 10, 2012
#1
eacousin...@gmail.com
Oct 10, 2012
So it should be straightforward to fix if you understand what's going on in _real_to_rational.
Labels:
EasyToFix
Jan 10, 2013
I think we can modify _real_to_rational to add a tolerance argument to it. Based on that, we can round the real number to given number of digits if the tolerance is provided. Does that sounds okay? Or is there something else we can do?
Jan 10, 2013
That sounds basically correct.
Jan 21, 2013
(No comment was entered for this change.)
Status:
Fixed
Jan 21, 2013
>>> nsimplify(0.5*x**2  3.333333*x, tolerance=0.001, rational=True) x**2/2  10*x/3
Mar 5, 2014
We have moved issues to GitHub https://github.com/sympy/sympy/issues.
Labels:
RestrictAddIssueCommentCommit
Apr 6, 2014
Migrated to http://github.com/sympy/sympy/issues/6527 

► Sign in to add a comment 