{"action":"created","issue":{"url":"https://api.github.com/repos/Theano/Theano/issues/2082","labels_url":"https://api.github.com/repos/Theano/Theano/issues/2082/labels{/name}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/2082/comments","events_url":"https://api.github.com/repos/Theano/Theano/issues/2082/events","html_url":"https://github.com/Theano/Theano/issues/2082","id":41949949,"number":2082,"title":"Add logaddexp as a binary elemwise, and logsumexp for its reduction","user":{"login":"lamblin","id":178249,"avatar_url":"https://avatars.githubusercontent.com/u/178249?v=3","gravatar_id":"","url":"https://api.github.com/users/lamblin","html_url":"https://github.com/lamblin","followers_url":"https://api.github.com/users/lamblin/followers","following_url":"https://api.github.com/users/lamblin/following{/other_user}","gists_url":"https://api.github.com/users/lamblin/gists{/gist_id}","starred_url":"https://api.github.com/users/lamblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamblin/subscriptions","organizations_url":"https://api.github.com/users/lamblin/orgs","repos_url":"https://api.github.com/users/lamblin/repos","events_url":"https://api.github.com/users/lamblin/events{/privacy}","received_events_url":"https://api.github.com/users/lamblin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Theano/Theano/labels/Enhancement","name":"Enhancement","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-09-04T15:27:45Z","updated_at":"2015-01-19T20:40:20Z","closed_at":null,"body":"NumPy implements it as:\r\n```\r\n@type@ npy_logaddexp@c@(@type@ x, @type@ y)\r\n{\r\n    const @type@ tmp = x - y;\r\n    if (tmp > 0) {\r\n        return x + npy_log1p@c@(npy_exp@c@(-tmp));\r\n    }\r\n    else if (tmp <= 0) {\r\n        return y + npy_log1p@c@(npy_exp@c@(tmp));\r\n    }\r\n    else {\r\n        /* NaNs, or infinities of the same sign involved */\r\n        return x + y;\r\n    }\r\n}\r\n```\r\nWe should also add the optimizations to automatically use it. Such an optimization already exists for the two-input case (inserting `log1p` directly), but not for the sum case (there is a `KnownFailureTest` already, but no implementation)."},"comment":{"url":"https://api.github.com/repos/Theano/Theano/issues/comments/70556913","html_url":"https://github.com/Theano/Theano/issues/2082#issuecomment-70556913","issue_url":"https://api.github.com/repos/Theano/Theano/issues/2082","id":70556913,"user":{"login":"abergeron","id":1002504,"avatar_url":"https://avatars.githubusercontent.com/u/1002504?v=3","gravatar_id":"","url":"https://api.github.com/users/abergeron","html_url":"https://github.com/abergeron","followers_url":"https://api.github.com/users/abergeron/followers","following_url":"https://api.github.com/users/abergeron/following{/other_user}","gists_url":"https://api.github.com/users/abergeron/gists{/gist_id}","starred_url":"https://api.github.com/users/abergeron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abergeron/subscriptions","organizations_url":"https://api.github.com/users/abergeron/orgs","repos_url":"https://api.github.com/users/abergeron/repos","events_url":"https://api.github.com/users/abergeron/events{/privacy}","received_events_url":"https://api.github.com/users/abergeron/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T20:40:20Z","updated_at":"2015-01-19T20:40:20Z","body":"The optimization should do automatically what is proposed in #1563.\r\n\r\nWe should also do something for adds with more than two inputs, possibly by reusing the above."}}