Comment #67 on issue 1694 by smichr: solve has many issues with fractions
http://code.google.com/p/sympy/issues/detail?id=1694
* these lines are uncovered
if flags.get('minimal_check', False):
return
if flags.get('solution_already_simplified', False):
continue
if flags.get('warning', False):
print("Warning: solution %s could not be verified." %sol)
* I don't understand why Add is left out of the first test where the
expression is turned into a fraction. *More significantly*, this portion
of code should not be added there. It should either be factored out
as a separate function, e.g. _handle_rational(eq, symbol, flags), or
tucked into the existing GS_* portions. Once you start doing this, the
whole purpose for which guess_* was added is defeated. (And if you see
my 1766 branch, my solve() routine, you will see that I know something
about what it looks like as you move away from that structure ;-)).
** For the above reason alone this patch is a -1 for me. **
But I continue with comments...
* since you set 'already_simplied' to True you should probably simplify
b as well before passing it to checksol
* in addition a and b should be P, Q or num, den to be more
descriptive.
* in checksol you use the flag 'solution_already_simplified' but send
'already_simplified'...which is perhaps why the line is uncovered in
tests.
I would prefer not introducing a new flag...just pass solve's flags and
let
checksol check for the 'simplified' flag that may be present.
* in checksol, 'wether' should be 'whether'
* in checksol, 'sympify(sol)' should be 'simplify(sol)'; the former
makes
something into a sympy object while the latter simplifies expressions.
Are
you making the same mistake in 'exp_positive =
sympify(f.exp).is_positive'?
* in checksol, the docstring code should be prettified with spaces:
>>> x, y = symbols('xy')
>>> checksol(x**4 - 1, x, 1)
True
>>> checksol(x**4 - 1, x, 0)
False
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.