def _expm_multiply_simple_core(A, B, t, mu, m_star, s, tol=None, balance=False):
 if balance:
  raise NotImplementedError
 if (tol is None):
  u_d = (2 ** (-53))
  tol = u_d
 F = B
 eta = np.exp(((t * mu) / float(s)))
 for i in range(s):
  c1 = _exact_inf_norm(B)
  for j in range(m_star):
   coeff = (t / float((s * (j + 1))))
   B = (coeff * A.dot(B))
   c2 = _exact_inf_norm(B)
   F = (F + B)
   if ((c1 + c2) <= (tol * _exact_inf_norm(F))):
    break
   c1 = c2
  F = (eta * F)
  B = F
 return F

def _expm_multiply_simple_core ( A , B , t , mu , m_star , s , tol = None , balance = False ) : if balance : raise NotImplementedError if ( tol is None ) : u_d = ( 2 ** ( - 53 ) ) tol = u_d F = B eta = np . exp ( ( ( t * mu ) / float ( s ) ) ) for i in range ( s ) : c1 = _exact_inf_norm ( B ) for j in range ( m_star ) : coeff = ( t / float ( ( s * ( j + 1 ) ) ) ) B = ( coeff * A . dot ( B ) ) c2 = _exact_inf_norm ( B ) F = ( F + B ) if ( ( c1 + c2 ) <= ( tol * _exact_inf_norm ( F ) ) ) : break c1 = c2 F = ( eta * F ) B = F return F
a helper function .