{"action":"closed","issue":{"url":"https://api.github.com/repos/dealii/dealii/issues/1652","labels_url":"https://api.github.com/repos/dealii/dealii/issues/1652/labels{/name}","comments_url":"https://api.github.com/repos/dealii/dealii/issues/1652/comments","events_url":"https://api.github.com/repos/dealii/dealii/issues/1652/events","html_url":"https://github.com/dealii/dealii/issues/1652","id":107798925,"number":1652,"title":"MappingQ1 throws floating point exception for point outside of cell","user":{"login":"gassmoeller","id":7582930,"avatar_url":"https://avatars.githubusercontent.com/u/7582930?v=3","gravatar_id":"","url":"https://api.github.com/users/gassmoeller","html_url":"https://github.com/gassmoeller","followers_url":"https://api.github.com/users/gassmoeller/followers","following_url":"https://api.github.com/users/gassmoeller/following{/other_user}","gists_url":"https://api.github.com/users/gassmoeller/gists{/gist_id}","starred_url":"https://api.github.com/users/gassmoeller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gassmoeller/subscriptions","organizations_url":"https://api.github.com/users/gassmoeller/orgs","repos_url":"https://api.github.com/users/gassmoeller/repos","events_url":"https://api.github.com/users/gassmoeller/events{/privacy}","received_events_url":"https://api.github.com/users/gassmoeller/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-22T20:49:00Z","updated_at":"2015-10-03T08:39:57Z","closed_at":"2015-10-03T08:39:57Z","body":"I am experiencing floating point exceptions in the recent development version of deal.II within MappingQ1:transform_real_to_unit_cell() that have not shown in 8.2 (last version I checked). The exception is triggered for some (but not all) points that lie outside of a cell. In my application I know that I will test (many) points that lie outside of a cell, but I only catch exceptions of type ExcTransformationFailed, that is why I noticed the floating point exception.\r\n\r\nMore precisely, the exception is triggered in line 124 of source/fe/mapping_q1.cc, because (-b + sqrt(discriminant)) is equal to zero. The special cases above this `else` should catch such situations, but I think it is not working for my case because of a round-off error. Let me explain by an example:\r\n\r\nFor the following values none of the special cases gets triggered (these are not values of an actual point, but the one that triggered the exception are very close, I rounded them for readability):\r\nb = 1e-4\r\nc = 1e-7\r\na = 1e-18\r\n\r\nBut still, due to round-off error (at least here on my machine):\r\n\r\nsqrt(discriminant) = sqrt(b*b - 4*a*c) == b,\r\nwhich results in a division-by-zero.\r\n\r\nShould there be another special case for this? Or am I missing something and such cases should not happen at all, and I need to look for the reason why I get to this situation?"}}