The only algorithm that I know for this problem is the Newton's method (make a guess, then improve it until it's good enough).
Any other ideas (use any language you prefer)?
PS: Of course I don't have any use case for this, I'm just researching it for academic reasons.