make sure to not pass negative numbers to sqrt(). Change-Id: Ifd200c781ae8a94c8a3c600401b60f4cf2430be3 related-bug: 3452750