{"action":"created","issue":{"url":"https://api.github.com/repos/chebfun/chebfun/issues/1615","labels_url":"https://api.github.com/repos/chebfun/chebfun/issues/1615/labels{/name}","comments_url":"https://api.github.com/repos/chebfun/chebfun/issues/1615/comments","events_url":"https://api.github.com/repos/chebfun/chebfun/issues/1615/events","html_url":"https://github.com/chebfun/chebfun/issues/1615","id":109349461,"number":1615,"title":"Different behavior with splitting on/off and a function with removable singularity","user":{"login":"gradywright","id":6304453,"avatar_url":"https://avatars.githubusercontent.com/u/6304453?v=3","gravatar_id":"","url":"https://api.github.com/users/gradywright","html_url":"https://github.com/gradywright","followers_url":"https://api.github.com/users/gradywright/followers","following_url":"https://api.github.com/users/gradywright/following{/other_user}","gists_url":"https://api.github.com/users/gradywright/gists{/gist_id}","starred_url":"https://api.github.com/users/gradywright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gradywright/subscriptions","organizations_url":"https://api.github.com/users/gradywright/orgs","repos_url":"https://api.github.com/users/gradywright/repos","events_url":"https://api.github.com/users/gradywright/events{/privacy}","received_events_url":"https://api.github.com/users/gradywright/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-01T17:48:52Z","updated_at":"2015-10-01T18:21:16Z","closed_at":null,"body":"Consider the function `g = @(x) log((x+3)/4)./(x-1)`, which comes from ATAP exercise 8.4 (c).  This function has a removable singularity at `x=1` (and branch point at `x=-3`).  Constructing `g` with standard Chebfun input gives:\r\n```\r\nf = chebfun(g)\r\nWarning: Function not resolved using 65537 pts. Have you tried 'splitting on'? \r\n> In chebfun.constructor>constructorNoSplit at 120\r\n  In chebfun.constructor at 63\r\n  In chebfun.chebfun>chebfun.chebfun at 219 \r\nf =\r\n   chebfun column (1 smooth piece)\r\n       interval       length     endpoint values  \r\n[      -1,       1]    65537      0.35     0.25 \r\nvscale = 3.465736e-01.\r\n```\r\nWhereas constructing with `splitting on` gives\r\n```\r\nfso = chebfun(g,'splitting','on')\r\nfso =\r\n   chebfun column (1 smooth piece)\r\n       interval       length     endpoint values  \r\n[      -1,       1]       18      0.35     0.25 \r\nvscale = 3.465736e-01.\r\n```\r\nPlotting the coefficients for the former case may help to illustrate what happens.\r\n\r\nNote that the accuracy of the splitting on case is about twice as high as the splitting off (unresolved) case:\r\n```\r\n>> x = linspace(-1,1,1001)'; x = x(2:end-1);\r\n>> norm(g(x)-fso(x),'inf')\r\nans =\r\n     9.225953334635051e-14\r\n>> norm(g(x)-f(x),'inf')\r\nans =\r\n     4.113376306236205e-14\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/chebfun/chebfun/issues/comments/144807574","html_url":"https://github.com/chebfun/chebfun/issues/1615#issuecomment-144807574","issue_url":"https://api.github.com/repos/chebfun/chebfun/issues/1615","id":144807574,"user":{"login":"aaustin141","id":3380006,"avatar_url":"https://avatars.githubusercontent.com/u/3380006?v=3","gravatar_id":"","url":"https://api.github.com/users/aaustin141","html_url":"https://github.com/aaustin141","followers_url":"https://api.github.com/users/aaustin141/followers","following_url":"https://api.github.com/users/aaustin141/following{/other_user}","gists_url":"https://api.github.com/users/aaustin141/gists{/gist_id}","starred_url":"https://api.github.com/users/aaustin141/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaustin141/subscriptions","organizations_url":"https://api.github.com/users/aaustin141/orgs","repos_url":"https://api.github.com/users/aaustin141/repos","events_url":"https://api.github.com/users/aaustin141/events{/privacy}","received_events_url":"https://api.github.com/users/aaustin141/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T18:21:16Z","updated_at":"2015-10-01T18:21:16Z","body":"This may be a machine-dependent thing, as the constructor without splitting works just fine for me:\r\n```\r\n>> g = @(x) log((x + 3)/4)./(x - 1);\r\n>> f = chebfun(g)\r\nf =\r\n   chebfun column (1 smooth piece)\r\n       interval       length     endpoint values  \r\n[      -1,       1]       19      0.35     0.25 \r\nvscale = 3.465736e-01.\r\n```"}}