Remove .is_finite assumption

fixes #5393
fixes #5385
fixes #7007
Merge pull request #7891 from skirpichev/remove-is_finite

Remove .is_finite assumption