On Fri, Feb 26, 2016 at 11:28 AM, Oscar Benjamin
<[email protected]> wrote:
> On 25 February 2016 at 15:30, Oscar Benjamin <[email protected]> 
> wrote:
>> On 25 February 2016 at 10:44, Yingchi Li <[email protected]> wrote:
>>>
>>> I have found a bug in factor() and simplify()
>>> please look at the image below
>>>
>>> the correct answer is q2 + 0.1
>>
>> Looks like a recent regression since I don't see it with 0.7.1 but I
>> do with master:
>
> I traced this to here:
>
> In [1]: expr = x*sin(y)**2 + x*cos(y)**2 + 0.1*sin(y)**2 + 0.1*cos(y)**2
>
> In [2]: p = Poly(expr, x, cos(y), sin(y), domain='RR')
>
> In [3]: p
> Out[3]: Poly(1.0*x*cos(y)**2 + 1.0*x*sin(y)**2 + 0.1*cos(y)**2 +
> 0.1*sin(y)**2, x, cos(y), sin(y), domain='RR')
>
> In [4]: p.rep
> Out[4]: DMP([[[1.0], [], [1.0, 0.0, 0.0]], [[0.1], [], [0.1, 0.0,
> 0.0]]], RR, None)
>
> In [5]: p.rep.factor_list()
> Out[5]:
> (1.0,
>  [(DMP([[[0.1], [], [0.1, 0.0, 0.0]]], RR, None), 1),
>   (DMP([[[1.0]], [[0.1]]], RR, None), 1)])
>
> I think the bug is in there somehow but I have no idea what it means.
> What is p.rep and how do you interpret it?

It's the internal representation of the polynomial. It's a list of
lists of lists of the coefficients (one level deep for each variable
of the polynomial). factor_list() has a bug with floating point
coefficients, it seems. Can you open an issue, if you haven't already?

Aaron Meurer

>
> --
> Oscar
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/CAHVvXxTc6KYEwEBP1GqN5eh-W0JgmsGxLD8DpR1HCAzD29%3DTEw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6LPGY-oF5QZVYqM6q_pnnEwxWGwLmX8yTUnrkj5%2BtGtKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to