In the version Mathemaica 10.4, I am very surprised that the core function Coefficient has changed, e.g.,

Coefficient[3 x x + 8 y y - 24 x y, 2 x y]


In previous versions (e.g. v9.0.1, v10.1.0), the result was -12. On the website wolframalpha, the result is still -12. According to comments, it seems like the change has happened from v10.1.0 to v10.2.0.

Yes, this change is very small, but I feel it is very dangerous for my previous research code. How do I know about these kind of changes in new versions? Is there a list explaining such changes?

  • 6
    $\begingroup$ I don't see 2*x*y occuring in 24*x*y. $\endgroup$ – Daniel Lichtblau Aug 10 '16 at 3:56
  • 3
    $\begingroup$ Dear @m_goldberg,If this is not a probelm? why v10.1.0 and v11 give different results? Maybe I am dumb. I don't understand why 0 is more reasonable? And I see '2*xy' in '12*xy'. Please give this problem more time before voting to close it, it doesn't hurt, right? $\endgroup$ – xinxin guo Aug 10 '16 at 7:37
  • 3
    $\begingroup$ Looks like a classic case of "undefined behavior". Coefficient wasn't meant to be used that way, so the outcome can change between versions, maybe even different runs of the same version. $\endgroup$ – Niki Estner Aug 10 '16 at 7:38
  • 6
    $\begingroup$ v9.0.1 yields -12 $\endgroup$ – Hector Aug 10 '16 at 8:33
  • 3
    $\begingroup$ What @nikie said. This is very much in the "undefined behavior" realm. In this instance, the old behavior was lost due to a bug fix that involved something slightly closer to intended usage. $\endgroup$ – Daniel Lichtblau Aug 10 '16 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.