{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/4596","labels_url":"https://api.github.com/repos/sympy/sympy/issues/4596/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/4596/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/4596/events","html_url":"https://github.com/sympy/sympy/issues/4596","id":28949889,"number":4596,"title":"Remove automatic distribution 2*(x + y) => 2*x + 2*y","user":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars.githubusercontent.com/u/71486?v=3","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sympy/sympy/labels/bug","name":"bug","color":"ededed"},{"url":"https://api.github.com/repos/sympy/sympy/labels/imported","name":"imported","color":"ededed"},{"url":"https://api.github.com/repos/sympy/sympy/labels/Priority%3A+Medium","name":"Priority: Medium","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars.githubusercontent.com/u/71486?v=3","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"milestone":null,"comments":30,"created_at":"2009-06-29T16:11:57Z","updated_at":"2015-01-22T23:16:40Z","closed_at":null,"body":"```\r\nI am not sure if this was done intentionally, but the following inconsistent output exists:\r\n>>> print -(x+y)/z\r\n(-x - y)/z\r\n>>> print (x+y)/-z\r\n-(x + y)/z\r\n\r\nNormally we wouldn't want to distribute numbers from the denominator, such as \r\n>>> print (x+y)/(2*z) # We don't want this\r\n(x/2 + y/2)/z\r\n\r\nbut I think there should be an exception for when the coefficient of the denominator is NegativeOne.  \r\n\r\nI have attached a patch that fixes this, but it breaks tests.  I don't have time to look into the tests, so unless someone \r\nwants to look into this, it will have to stay the way that it is.\r\n```\r\nOriginal issue for #4596: http://code.google.com/p/sympy/issues/detail?id=1497\r\nOriginal author: https://code.google.com/u/asmeurer@gmail.com/\r\nOriginal owner: https://code.google.com/u/asmeurer@gmail.com/\r\n"},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/71119328","html_url":"https://github.com/sympy/sympy/issues/4596#issuecomment-71119328","issue_url":"https://api.github.com/repos/sympy/sympy/issues/4596","id":71119328,"user":{"login":"certik","id":20568,"avatar_url":"https://avatars.githubusercontent.com/u/20568?v=3","gravatar_id":"","url":"https://api.github.com/users/certik","html_url":"https://github.com/certik","followers_url":"https://api.github.com/users/certik/followers","following_url":"https://api.github.com/users/certik/following{/other_user}","gists_url":"https://api.github.com/users/certik/gists{/gist_id}","starred_url":"https://api.github.com/users/certik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/certik/subscriptions","organizations_url":"https://api.github.com/users/certik/orgs","repos_url":"https://api.github.com/users/certik/repos","events_url":"https://api.github.com/users/certik/events{/privacy}","received_events_url":"https://api.github.com/users/certik/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T23:16:40Z","updated_at":"2015-01-22T23:16:40Z","body":"The only motivation for `a-a` to simplify is that this operation happens extremely often in symbolic algorithms, consider for example Gaussian elimination, where you subtract expressions etc. While `-a*z+a*z` doesn't happen that often I would think."}}