{"action":"created","issue":{"url":"https://api.github.com/repos/chebfun/chebfun/issues/1410","labels_url":"https://api.github.com/repos/chebfun/chebfun/issues/1410/labels{/name}","comments_url":"https://api.github.com/repos/chebfun/chebfun/issues/1410/comments","events_url":"https://api.github.com/repos/chebfun/chebfun/issues/1410/events","html_url":"https://github.com/chebfun/chebfun/issues/1410","id":58509609,"number":1410,"title":"bug in `doublelength`","user":{"login":"trefethen","id":3601488,"avatar_url":"https://avatars.githubusercontent.com/u/3601488?v=3","gravatar_id":"","url":"https://api.github.com/users/trefethen","html_url":"https://github.com/trefethen","followers_url":"https://api.github.com/users/trefethen/followers","following_url":"https://api.github.com/users/trefethen/following{/other_user}","gists_url":"https://api.github.com/users/trefethen/gists{/gist_id}","starred_url":"https://api.github.com/users/trefethen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trefethen/subscriptions","organizations_url":"https://api.github.com/users/trefethen/orgs","repos_url":"https://api.github.com/users/trefethen/repos","events_url":"https://api.github.com/users/trefethen/events{/privacy}","received_events_url":"https://api.github.com/users/trefethen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chebfun/chebfun/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"hrothgar","id":913747,"avatar_url":"https://avatars.githubusercontent.com/u/913747?v=3","gravatar_id":"","url":"https://api.github.com/users/hrothgar","html_url":"https://github.com/hrothgar","followers_url":"https://api.github.com/users/hrothgar/followers","following_url":"https://api.github.com/users/hrothgar/following{/other_user}","gists_url":"https://api.github.com/users/hrothgar/gists{/gist_id}","starred_url":"https://api.github.com/users/hrothgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrothgar/subscriptions","organizations_url":"https://api.github.com/users/hrothgar/orgs","repos_url":"https://api.github.com/users/hrothgar/repos","events_url":"https://api.github.com/users/hrothgar/events{/privacy}","received_events_url":"https://api.github.com/users/hrothgar/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-02-22T17:05:47Z","updated_at":"2015-02-23T09:48:37Z","closed_at":null,"body":"`doublelength` seems to be producing results that are too big by 2, in both standard and trig mode.  Thus for example:\r\n```\r\n>> length(chebfun('x','doublelength'))\r\nans =  5\r\n>> length(chebfun('sin(pi*x)','trig','doublelength'))\r\nans = 7\r\n```\r\nThe results here should be 3 and 5.  I'm a little puzzled how this slipped by us... am I missing something?\r\n\r\nI am taking the liberty of assigning this hopefully very minor fix to @hrothgar, since he's been involved in `doublelength` already and, more to the point, I encountered this problem when writing an Example to illustrate `doublelength`, which I have just sent to @hrothgar to install when the moment is right.\r\n\r\nBTW I also didn't spot any documentation of `doublength` (which presumably should appear in the `help chebfun` text), but the bug is the main thing here."},"comment":{"url":"https://api.github.com/repos/chebfun/chebfun/issues/comments/75513842","html_url":"https://github.com/chebfun/chebfun/issues/1410#issuecomment-75513842","issue_url":"https://api.github.com/repos/chebfun/chebfun/issues/1410","id":75513842,"user":{"login":"hrothgar","id":913747,"avatar_url":"https://avatars.githubusercontent.com/u/913747?v=3","gravatar_id":"","url":"https://api.github.com/users/hrothgar","html_url":"https://github.com/hrothgar","followers_url":"https://api.github.com/users/hrothgar/followers","following_url":"https://api.github.com/users/hrothgar/following{/other_user}","gists_url":"https://api.github.com/users/hrothgar/gists{/gist_id}","starred_url":"https://api.github.com/users/hrothgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrothgar/subscriptions","organizations_url":"https://api.github.com/users/hrothgar/orgs","repos_url":"https://api.github.com/users/hrothgar/repos","events_url":"https://api.github.com/users/hrothgar/events{/privacy}","received_events_url":"https://api.github.com/users/hrothgar/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T09:48:37Z","updated_at":"2015-02-23T09:48:37Z","body":"Doublelength creates a chebfun of length 2\\*N+1, where N is the length the constructor would normally choose. Since `chebfun('x')` is of length 2, `chebfun('x','doublelength')` creates a chebfun of length 2\\*2+1 = 5. And since the trig representation of sin(pi\\*x) is of length 3, the doublelength version is of length 2\\*3+1 = 7.\r\n\r\n(The reason we did 2*N+1 was to maintain odd degree in the trig representations. The reason we haven't created separate rules for trig and Chebyshev representations is that it would be too much work.)\r\n\r\nDo you think the rule should be changed to 2*N–1?\r\n\r\nThanks for pointing out the missing documentation. I'll take care of that."}}