20

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]

0

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?

István Zachar
  • 47,032
  • 20
  • 143
  • 291
Orders
  • 1,247
  • 11
  • 20
  • v10.4.1 gives 0 also. Any change occurred prior to v11.0 – Bob Hanlon Aug 10 '16 at 02:19
  • I know v10.4.0 gives -12. Anyway, this core function has changed. – Orders Aug 10 '16 at 02:23
  • It must be system-dependent because v10.4.0 and v10.4.1 on my Mac gives 0 – Bob Hanlon Aug 10 '16 at 02:26
  • WolframLanguageData["Coefficient", "VersionLastModified"] returns 3. Therefore any change since v10.4.1 might not had been intentional. – Karsten7 Aug 10 '16 at 02:36
  • On my Mac the change appears to have occurred going from 10.1.0 to 10.2.0 – Bob Hanlon Aug 10 '16 at 02:41
  • 2
    @Karsten7. I don't know what meaning of your 3,But as WolframLanguageData["Coefficient", "DateLastModified"], we can see wolfram have not change this function. – yode Aug 10 '16 at 02:45
  • 1
    @yode, since it is the result of "VersionLastModified", it means the function was last changed in version 3. – J. M.'s missing motivation Aug 10 '16 at 03:04
  • Coefficient[3 x x + 8 y y - 24 x y, 2 x y] evaluates to -12 in 10.1.0 under Windows 7 x64, which agrees with Bob Hanlon's result. – Mr.Wizard Aug 10 '16 at 03:05
  • 6
    I don't see 2*x*y occuring in 24*x*y. – Daniel Lichtblau Aug 10 '16 at 03:56
  • Yes, I agree, the result 0 is more reasonable. Or we can think new version mathematica just fixed a bug for this function ? – Orders Aug 10 '16 at 05:33
  • 1
    I'm voting to close this question as off-topic because the behavior the OP is reporting is not a change from V10 – m_goldberg Aug 10 '16 at 06:24
  • @m_goldberg What's this behavior in your opinion ? I am still very curious about this problem. – Orders Aug 10 '16 at 07:17
  • There is no problem. – m_goldberg Aug 10 '16 at 07:21
  • 3
    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 '2xy' in '12xy'. Please give this problem more time before voting to close it, it doesn't hurt, right? – xinxin guo Aug 10 '16 at 07:37
  • 3
    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. – Niki Estner Aug 10 '16 at 07:38
  • 1
    V10.4 also gives zero. Nothing changed between V10.4 and V11. – m_goldberg Aug 10 '16 at 07:51
  • 6
    v9.0.1 yields -12 – Hector Aug 10 '16 at 08:33
  • 3
    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. – Daniel Lichtblau Aug 10 '16 at 14:57
  • Is (26510) affected by this change/fix? – Mr.Wizard Aug 15 '16 at 06:54
  • @Mr.Wizard No. I have know that problem for a long time. So, to be safe, when I used Cofficient[exp], I always need to ExpandAll the exp. But, here, more seriously, the result is different with the previous version. Some rule for this function has been changed ? I am not sure. – Orders Aug 15 '16 at 07:40
  • 1
    @Orders Related: 103018. Personally, I can understand your concerns very well. I think that it is a very poor practice to change behavior of core functions without putting any announcements to the changelog. – vsht Aug 16 '16 at 18:39
  • voted to close as I don't see there is any way to answer other than speculation, and it shouldn't be sitting on the unanswered list. BTW can anyone likes the old behavior explain why Coefficient[ x y, 2. x y ] gives .5 and Coefficient[ x y, Pi x y ] is zero? – george2079 Dec 23 '16 at 16:15

0 Answers0