{"action":"created","comment":{"url":"https://api.github.com/repos/sympy/sympy/pulls/comments/111691745","pull_request_review_id":32951143,"id":111691745,"diff_hunk":"@@ -1555,9 +1555,15 @@ def _expand(p):\n                     u = poly.gen\n                     if u != symbol:\n                         try:\n+                            if deg == 1:\n+                                if checksol(f, symbol, soln[0]):\n+                                    temp_soln = soln\n                             t = Dummy('t')\n                             iv = _solve(u - t, symbol, **flags)\n                             soln = list(ordered({i.subs(t, s) for i in iv for s in soln}))\n+                            soln[:] = (val for val in soln if val != S.NaN)\n+                            if not soln:\n+                                soln = temp_soln","path":"sympy/solvers/solvers.py","position":12,"original_position":12,"commit_id":"d3133d939e0e72ec95cb84ea967db102c0aa9be9","original_commit_id":"d3133d939e0e72ec95cb84ea967db102c0aa9be9","user":{"login":"valglad","id":20492235,"avatar_url":"https://avatars3.githubusercontent.com/u/20492235?v=3","gravatar_id":"","url":"https://api.github.com/users/valglad","html_url":"https://github.com/valglad","followers_url":"https://api.github.com/users/valglad/followers","following_url":"https://api.github.com/users/valglad/following{/other_user}","gists_url":"https://api.github.com/users/valglad/gists{/gist_id}","starred_url":"https://api.github.com/users/valglad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valglad/subscriptions","organizations_url":"https://api.github.com/users/valglad/orgs","repos_url":"https://api.github.com/users/valglad/repos","events_url":"https://api.github.com/users/valglad/events{/privacy}","received_events_url":"https://api.github.com/users/valglad/received_events","type":"User","site_admin":false},"body":"`temp_soln` contains solutions to the polynomial, not to the original equation. `soln` is meant to contain solutions to the original equation so assigning `temp_soln` to it is wrong. Also, you are still not letting `_solve()` search further after you remove an `S.NaN` (like, in the case of `x**(2/x)-3*x*(1/x)+2`: you'll miss 1 as a solution).","created_at":"2017-04-16T20:45:58Z","updated_at":"2017-04-16T20:47:34Z","html_url":"https://github.com/sympy/sympy/pull/12542#discussion_r111691745","pull_request_url":"https://api.github.com/repos/sympy/sympy/pulls/12542","_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments/111691745"},"html":{"href":"https://github.com/sympy/sympy/pull/12542#discussion_r111691745"},"pull_request":{"href":"https://api.github.com/repos/sympy/sympy/pulls/12542"}}},"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/12542","id":115910600,"html_url":"https://github.com/sympy/sympy/pull/12542","diff_url":"https://github.com/sympy/sympy/pull/12542.diff","patch_url":"https://github.com/sympy/sympy/pull/12542.patch","issue_url":"https://api.github.com/repos/sympy/sympy/issues/12542","number":12542,"state":"open","locked":false,"title":"fixes issue#12538","user":{"login":"Yathartha22","id":14955840,"avatar_url":"https://avatars2.githubusercontent.com/u/14955840?v=3","gravatar_id":"","url":"https://api.github.com/users/Yathartha22","html_url":"https://github.com/Yathartha22","followers_url":"https://api.github.com/users/Yathartha22/followers","following_url":"https://api.github.com/users/Yathartha22/following{/other_user}","gists_url":"https://api.github.com/users/Yathartha22/gists{/gist_id}","starred_url":"https://api.github.com/users/Yathartha22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yathartha22/subscriptions","organizations_url":"https://api.github.com/users/Yathartha22/orgs","repos_url":"https://api.github.com/users/Yathartha22/repos","events_url":"https://api.github.com/users/Yathartha22/events{/privacy}","received_events_url":"https://api.github.com/users/Yathartha22/received_events","type":"User","site_admin":false},"body":"This PR is an attempt to fix the issue of `solve` not able to solve equation `x**(1/x) - 1`.\r\nfixes [issue#12538](https://github.com/sympy/sympy/issues/12538).\r\n\r\nAfter finding out the `roots` `solve` again tries to find a solution by solving `x**(1/x) - t` , which sometimes makes it even more complicated to solve(like in this case).\r\nI tried apply a heuristic approach by checking if `_solve` is able to find out the `roots` and in case solving again leads to a solution not appropriate(possibly a `NaN`) it would take `roots` as its result.\r\n\r\nping @asmeurer @smichr ","created_at":"2017-04-14T09:57:56Z","updated_at":"2017-04-16T20:47:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c179dbf777f23b8d40cd2c6202d8a7450d76549","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sympy/sympy/pulls/12542/commits","review_comments_url":"https://api.github.com/repos/sympy/sympy/pulls/12542/comments","review_comment_url":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/12542/comments","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/d3133d939e0e72ec95cb84ea967db102c0aa9be9","head":{"label":"Yathartha22:issue#12538","ref":"issue#12538","sha":"d3133d939e0e72ec95cb84ea967db102c0aa9be9","user":{"login":"Yathartha22","id":14955840,"avatar_url":"https://avatars2.githubusercontent.com/u/14955840?v=3","gravatar_id":"","url":"https://api.github.com/users/Yathartha22","html_url":"https://github.com/Yathartha22","followers_url":"https://api.github.com/users/Yathartha22/followers","following_url":"https://api.github.com/users/Yathartha22/following{/other_user}","gists_url":"https://api.github.com/users/Yathartha22/gists{/gist_id}","starred_url":"https://api.github.com/users/Yathartha22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yathartha22/subscriptions","organizations_url":"https://api.github.com/users/Yathartha22/orgs","repos_url":"https://api.github.com/users/Yathartha22/repos","events_url":"https://api.github.com/users/Yathartha22/events{/privacy}","received_events_url":"https://api.github.com/users/Yathartha22/received_events","type":"User","site_admin":false},"repo":{"id":77686804,"name":"sympy","full_name":"Yathartha22/sympy","owner":{"login":"Yathartha22","id":14955840,"avatar_url":"https://avatars2.githubusercontent.com/u/14955840?v=3","gravatar_id":"","url":"https://api.github.com/users/Yathartha22","html_url":"https://github.com/Yathartha22","followers_url":"https://api.github.com/users/Yathartha22/followers","following_url":"https://api.github.com/users/Yathartha22/following{/other_user}","gists_url":"https://api.github.com/users/Yathartha22/gists{/gist_id}","starred_url":"https://api.github.com/users/Yathartha22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yathartha22/subscriptions","organizations_url":"https://api.github.com/users/Yathartha22/orgs","repos_url":"https://api.github.com/users/Yathartha22/repos","events_url":"https://api.github.com/users/Yathartha22/events{/privacy}","received_events_url":"https://api.github.com/users/Yathartha22/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Yathartha22/sympy","description":"A computer algebra system written in pure Python","fork":true,"url":"https://api.github.com/repos/Yathartha22/sympy","forks_url":"https://api.github.com/repos/Yathartha22/sympy/forks","keys_url":"https://api.github.com/repos/Yathartha22/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yathartha22/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yathartha22/sympy/teams","hooks_url":"https://api.github.com/repos/Yathartha22/sympy/hooks","issue_events_url":"https://api.github.com/repos/Yathartha22/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/Yathartha22/sympy/events","assignees_url":"https://api.github.com/repos/Yathartha22/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/Yathartha22/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/Yathartha22/sympy/tags","blobs_url":"https://api.github.com/repos/Yathartha22/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yathartha22/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yathartha22/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yathartha22/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yathartha22/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/Yathartha22/sympy/languages","stargazers_url":"https://api.github.com/repos/Yathartha22/sympy/stargazers","contributors_url":"https://api.github.com/repos/Yathartha22/sympy/contributors","subscribers_url":"https://api.github.com/repos/Yathartha22/sympy/subscribers","subscription_url":"https://api.github.com/repos/Yathartha22/sympy/subscription","commits_url":"https://api.github.com/repos/Yathartha22/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yathartha22/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yathartha22/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yathartha22/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yathartha22/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/Yathartha22/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yathartha22/sympy/merges","archive_url":"https://api.github.com/repos/Yathartha22/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yathartha22/sympy/downloads","issues_url":"https://api.github.com/repos/Yathartha22/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/Yathartha22/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/Yathartha22/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/Yathartha22/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yathartha22/sympy/labels{/name}","releases_url":"https://api.github.com/repos/Yathartha22/sympy/releases{/id}","deployments_url":"https://api.github.com/repos/Yathartha22/sympy/deployments","created_at":"2016-12-30T13:07:17Z","updated_at":"2016-12-30T13:07:25Z","pushed_at":"2017-04-16T02:51:07Z","git_url":"git://github.com/Yathartha22/sympy.git","ssh_url":"git@github.com:Yathartha22/sympy.git","clone_url":"https://github.com/Yathartha22/sympy.git","svn_url":"https://github.com/Yathartha22/sympy","homepage":"http://sympy.org/","size":77413,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sympy:master","ref":"master","sha":"21208cb537c0fbba63202b51c62fb2140ebc94fe","user":{"login":"sympy","id":260832,"avatar_url":"https://avatars2.githubusercontent.com/u/260832?v=3","gravatar_id":"","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"repo":{"id":640534,"name":"sympy","full_name":"sympy/sympy","owner":{"login":"sympy","id":260832,"avatar_url":"https://avatars2.githubusercontent.com/u/260832?v=3","gravatar_id":"","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sympy/sympy","description":"A computer algebra system written in pure Python","fork":false,"url":"https://api.github.com/repos/sympy/sympy","forks_url":"https://api.github.com/repos/sympy/sympy/forks","keys_url":"https://api.github.com/repos/sympy/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sympy/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sympy/sympy/teams","hooks_url":"https://api.github.com/repos/sympy/sympy/hooks","issue_events_url":"https://api.github.com/repos/sympy/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/sympy/sympy/events","assignees_url":"https://api.github.com/repos/sympy/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/sympy/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/sympy/sympy/tags","blobs_url":"https://api.github.com/repos/sympy/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sympy/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sympy/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sympy/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/sympy/sympy/languages","stargazers_url":"https://api.github.com/repos/sympy/sympy/stargazers","contributors_url":"https://api.github.com/repos/sympy/sympy/contributors","subscribers_url":"https://api.github.com/repos/sympy/sympy/subscribers","subscription_url":"https://api.github.com/repos/sympy/sympy/subscription","commits_url":"https://api.github.com/repos/sympy/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sympy/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sympy/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sympy/sympy/issues/comments{/number}","contents_url":"https://api.github.com/repos/sympy/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/sympy/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sympy/sympy/merges","archive_url":"https://api.github.com/repos/sympy/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sympy/sympy/downloads","issues_url":"https://api.github.com/repos/sympy/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/sympy/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/sympy/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/sympy/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sympy/sympy/labels{/name}","releases_url":"https://api.github.com/repos/sympy/sympy/releases{/id}","deployments_url":"https://api.github.com/repos/sympy/sympy/deployments","created_at":"2010-04-30T20:37:14Z","updated_at":"2017-04-16T18:21:12Z","pushed_at":"2017-04-16T18:25:20Z","git_url":"git://github.com/sympy/sympy.git","ssh_url":"git@github.com:sympy/sympy.git","clone_url":"https://github.com/sympy/sympy.git","svn_url":"https://github.com/sympy/sympy","homepage":"http://sympy.org/","size":78229,"stargazers_count":3757,"watchers_count":3757,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1900,"mirror_url":null,"open_issues_count":2839,"forks":1900,"open_issues":2839,"watchers":3757,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/12542"},"html":{"href":"https://github.com/sympy/sympy/pull/12542"},"issue":{"href":"https://api.github.com/repos/sympy/sympy/issues/12542"},"comments":{"href":"https://api.github.com/repos/sympy/sympy/issues/12542/comments"},"review_comments":{"href":"https://api.github.com/repos/sympy/sympy/pulls/12542/comments"},"review_comment":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sympy/sympy/pulls/12542/commits"},"statuses":{"href":"https://api.github.com/repos/sympy/sympy/statuses/d3133d939e0e72ec95cb84ea967db102c0aa9be9"}}}}
{"actor":{"display_login":"valglad"}}