Oh. I have taken a wrong approach to the problem. I have written Newton method with cutting precision if it's more than N digits, and it finds an answer practically in no time. But still, it's very good, thank you!