Scala: trying to find sqrt(-2) using Newton's method.