Comment #95 on issue 1694 by sophie.duriez: solve has many issues with
fractions
http://code.google.com/p/sympy/issues/detail?id=1694
@Vinzent (91):
"Maybe we should add a "strategy" kwarg, like in dsolve()."
We may do that for .as_numer_denom().
- Strategy 1 (the current one):
n, d = f.as_numer_denom()
sols = solve(n, ...)
for sol in sols:
if checksol(d, symbol, sol):
...
- Strategy 2:
n, d = f.as_numer_denom()
sols = solve(f, ...) # keep f for solving
for sol in sols:
if checksol(d, symbol, sol): # d is still used to remove singularities
...
"However, "If you want the best result, you set "strategy='best'", and
solve() tries all approaches and gives you the best."
How could sympy decide that
-log(4) + log(2*y + 2*sqrt(-4 + y**2))
is better than
log(-16 + 8*y*(-4 + y**2)**(1/2) + 8*y**2)/2 - log(16)/2 ?
Maybe we could count recursively the number of operations involved in each
one... ?
@smirch
"If you mean "do I have a change that doesn't fail for those?" then yes, in
branch 'rev2', commit 'nic solver mods' the result in 32-bit is 'log(-1 +
y*(-4 + y**2)**(1/2)/2 + y**2/2)/2' but when I tried to fix other things
then I get 'nan'."
I'm not sure I understand this. Your changes fix this issues, but other
appear, did I understood ?
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.