Comment #8 on issue 1694 by smichr: solve has many issues with fractions
http://code.google.com/p/sympy/issues/detail?id=1694

In the segment to check if Q != 0, you simply test Q without expanding or
simplifying. But simple exressions like the following will not test to be  
zero unless
you expand them:

###
>>> eq
-a + a*(1 + b) - a*b
>>> eq.is_zero
>>> eq.is_nonzero
###

At least expanding would be a step in the right direction, I think. I don't  
think it
will solve every problem, but it will solve more than doing nothing. I also  
wonder if
going through an inversion process (like what is used in solve), trying to  
solve for
any one of the variables in the expression (or all in turn), might work. At  
some
point the expression should(?) become simple enough that you find that 0 ==  
0.

If there are no variables in the expression (and there are no Real's in it)  
will
sympy ever have a problem ascertaining that the expression is 0? Let's  
see...

###
>>> eq
-a + a*(1 + b) - a*b
>>> eq.subs(a,sqrt(1+sqrt(3)))
(1 + 3**(1/2))**(1/2)*(1 + b) - (1 + 3**(1/2))**(1/2) - b*(1 +  
3**(1/2))**(1/2)
>>> _.subs(b,1/(1+sqrt(3)))
(1 + 3**(1/2))**(1/2)*(1 + 1/(1 + 3**(1/2))) - (1 + 3**(1/2))**(1/2) - 1/(1  
+ 3*
*(1/2))**(1/2)
>>> z=_
>>> z.expand()
0
###

sympy didn't recognize that the intermediate forms were 0 but once expand  
was used
then it did.

/c

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to