def _minpoly_rootof(ex, x):
 p = ex.expr
 p = p.subs({ex.poly.gens[0]: x})
 (_, factors) = factor_list(p, x)
 result = _choose_factor(factors, x, ex)
 return result

def _minpoly_rootof ( ex , x ) : p = ex . expr p = p . subs ( { ex . poly . gens [ 0 ] : x } ) ( _ , factors ) = factor_list ( p , x ) result = _choose_factor ( factors , x , ex ) return result
returns the minimal polynomial of a crootof object .