On Dec 6, 8:23 pm, smichr <[email protected]> wrote:
> I'm away from my own computer right now, Vinzent, but from what you've
> shown above this looks like an issue in distributing the minus sign
> (what I refer to as the 2-arg mul: a constant distributes over a
> single Add). There is another matrix test, I believe, that had that
> problem and it was handled with double parenthesis, something like
>
> -((numer)/den) rather than -(numer)/den
>
> By putting (numer)/den in parenthesis, it is no longer an Add that the
> -1 is multiplying so you don't get the automatic distribution.
> Here's a demo from live.sympy:
>
> >>> sol2=-(4*log(7) + 
> >>> 5*LambertW(-7*2**Rational(4,5)*6**Rational(1,5)*log(7)/10))/(3*log(7))
> >>> sol2
>
> (-5*LambertW(-7*2**(4/5)*6**(1/5)*log(7)/10) - 4*log(7))/(3*log(7))
>
> >>> sol3=-((4*log(7) + 
> >>> 5*LambertW(-7*2**Rational(4,5)*6**Rational(1,5)*log(7)/10))/(3*log(7)))
> >>> sol3
>
> -(4*log(7) + 5*LambertW(-7*2**(4/5)*6**(1/5)*log(7)/10))/(3*log(7))>>> 
> sol3==ans
>
> True

I get always False here:

In [1]: sol2=-(4*log(7) +
5*LambertW(-7*2**Rational(4,5)*6**Rational(1,5)*log(7)/10))/
(3*log(7))
In [2]: sol3=-((4*log(7) +
5*LambertW(-7*2**Rational(4,5)*6**Rational(1,5)*log(7)/10))/
(3*log(7)))

In [3]: sol2
Out[3]:
            ⎛    4/5 5 ⎽⎽⎽       ⎞
            ⎜-7⋅2   ⋅╲╱ 6 ⋅log(7)⎟
- 5⋅LambertW⎜────────────────────⎟ - 4⋅log(7)
            ⎝         10         ⎠
─────────────────────────────────────────────
                   3⋅log(7)

In [4]: sol3
Out[4]:
 ⎛                     ⎛    4/5 5 ⎽⎽⎽       ⎞⎞
 ⎜                     ⎜-7⋅2   ⋅╲╱ 6 ⋅log(7)⎟⎟
-⎜4⋅log(7) + 5⋅LambertW⎜────────────────────⎟⎟
 ⎝                     ⎝         10         ⎠⎠
──────────────────────────────────────────────
                   3⋅log(7)

In [5]: sol2==sol3
Out[5]: False

In [6]: s = solve(2*(3*x+4)**5 - 6*7**(3*x+9), x)

In [7]: s
Out[7]:
⎡ ⎛                     ⎛   5 ⎽⎽⎽       ⎞⎞⎤
⎢ ⎜                     ⎜-7⋅╲╱ 3 ⋅log(7)⎟⎟⎥
⎢-⎜4⋅log(7) + 5⋅LambertW⎜───────────────⎟⎟⎥
⎢ ⎝                     ⎝       5       ⎠⎠⎥
⎢─────────────────────────────────────────⎥
⎣                 3⋅log(7)                ⎦

In [8]: ans = s[0]

In [9]: ans
Out[9]:
 ⎛                     ⎛   5 ⎽⎽⎽       ⎞⎞
 ⎜                     ⎜-7⋅╲╱ 3 ⋅log(7)⎟⎟
-⎜4⋅log(7) + 5⋅LambertW⎜───────────────⎟⎟
 ⎝                     ⎝       5       ⎠⎠
─────────────────────────────────────────
                 3⋅log(7)

In [10]: ans==sol2
Out[10]: False

In [11]: ans==sol3
Out[11]: False



Vinzent

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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?hl=en.

Reply via email to