Implement sqrt function.