fix JIRA ROOT-5882 - protect agatinst sqrt (<0) and 1/0 in