{"comment":{"url":"https://api.github.com/repos/abhinavagarwal07/symengine/comments/15249518","html_url":"https://github.com/abhinavagarwal07/symengine/commit/09e2a45dbc23fc30bf9dc7849d23cf930e93d659#commitcomment-15249518","id":15249518,"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},"position":null,"line":null,"path":"","commit_id":"09e2a45dbc23fc30bf9dc7849d23cf930e93d659","created_at":"2016-01-04T18:39:30Z","updated_at":"2016-01-04T18:39:30Z","body":"This can fail if `polygamma` returns something else than `PolyGamma`, i.e. it is not safe. After we fix #426, then at least in Debug mode this would fail nicely. But in this case I would just write it as:\r\n```c++\r\nr1 = rcp_dynamic_cast<const PolyGamma>(polygamma(i2, x))->.rewrite_as_zeta(); \r\n```\r\nThis will raise an exception if `polygamma` simplifies to e.g. a number."}}