title: Solving an equation with high powers in Python
body: <p>How to calculate a one-unknown equation that has exponentiation with a high exponent?</p>
  <p>I try to use SymPy solveset, but I am getting an error:</p>
  <blockquote>
  <p>mpmath.libmp.libhyper.NoConvergence: convergence to root failed; try n &lt; 15 or maxsteps &gt; 50</p>
  </blockquote>
  <pre><code>from __future__ import division
  from sympy import *
  
  n = Symbol('n', real=True, positive=True)
  d = Symbol('d', real=True, positive=True)
  i = Symbol('i', real=True, positive=True)
  o = Symbol('o', real=True, positive=True)
  z = Symbol('z', real=True, positive=True)
  eq_left = Symbol('eq_left', real=True, positive=True)
  eq_right = Symbol('eq_right', real=True, positive=True)
  
  d = 100
  i = 0.0001
  o = 0.0001
  
  eq_left = (1 + d*(z/n))**n
  eq_right = (1 + d*(z/(n+1)))**(n+1)*(1-d*i)*(1-d*o)
  
  for every in range(1, 41):
    n = every
    results = solveset(Eq(eq_left, eq_right), z, domain=S.Reals)
    print(results)
  </code></pre>
  <p>My only unknown is &quot;z&quot; variable and I need to calculate it for the changing &quot;n&quot; variable, which is a power in range even to 40, but near 12 I am getting mentioned error.</p>
  <ol>
  <li>How can I resolve this equation using such a high exponentation?</li>
  <li>The second issue is performance. For ever higher powers, the computation time is getting longer. My guess is the solveset function would count an exponent of 40 for an hour.</li>
  </ol>