def _briggs_helper_function(a, k):
 if ((k < 0) or (int(k) != k)):
  raise ValueError('expected a nonnegative integer k')
 if (k == 0):
  return (a - 1)
 elif (k == 1):
  return (np.sqrt(a) - 1)
 else:
  k_hat = k
  if (np.angle(a) >= (np.pi / 2)):
   a = np.sqrt(a)
   k_hat = (k - 1)
  z0 = (a - 1)
  a = np.sqrt(a)
  r = (1 + a)
  for j in range(1, k_hat):
   a = np.sqrt(a)
   r = (r * (1 + a))
  r = (z0 / r)
  return r

def _briggs_helper_function ( a , k ) : if ( ( k < 0 ) or ( int ( k ) != k ) ) : raise ValueError ( 'expected a nonnegative integer k' ) if ( k == 0 ) : return ( a - 1 ) elif ( k == 1 ) : return ( np . sqrt ( a ) - 1 ) else : k_hat = k if ( np . angle ( a ) >= ( np . pi / 2 ) ) : a = np . sqrt ( a ) k_hat = ( k - 1 ) z0 = ( a - 1 ) a = np . sqrt ( a ) r = ( 1 + a ) for j in range ( 1 , k_hat ) : a = np . sqrt ( a ) r = ( r * ( 1 + a ) ) r = ( z0 / r ) return r
computes r = a^(1 / ) - 1 .