def _calc_beta(rk, rk_norm, rk1, rk1_norm):
 rkk1 = (rk1[0] - rk[0])
 size = np.sqrt(np.dot(rkk1, rkk1))
 rkk1 /= size
 num = (rk_norm + np.dot(rk, rkk1))
 den = (rk1_norm + np.dot(rk1, rkk1))
 res = (np.log((num / den)) / size)
 return res

def _calc_beta ( rk , rk_norm , rk1 , rk1_norm ) : rkk1 = ( rk1 [ 0 ] - rk [ 0 ] ) size = np . sqrt ( np . dot ( rkk1 , rkk1 ) ) rkk1 /= size num = ( rk_norm + np . dot ( rk , rkk1 ) ) den = ( rk1_norm + np . dot ( rk1 , rkk1 ) ) res = ( np . log ( ( num / den ) ) / size ) return res
these coefficients are used to calculate the magic vector omega .