#NEWLINE# def test_return_root_of( ) : #NEWLINE# #INDENT# f = ( ( ( ( ( x ** 5 ) - ( 15 * ( x ** 3 ) ) ) - ( 5 * ( x ** 2 ) ) ) + ( 10 * x ) ) + 20 ) #NEWLINE# s = list ( solveset_complex ( f , x ) ) #NEWLINE# for root in s : #NEWLINE# #INDENT# assert ( root . func == CRootOf ) #NEWLINE# #UNINDENT# assert ( nfloat ( list ( solveset_complex ( ( ( ( x ** 5 ) + ( 3 * ( x ** 3 ) ) ) + 7 ) , x ) ) [ 0 ] , exponent = False ) == CRootOf ( ( ( ( x ** 5 ) + ( 3 * ( x ** 3 ) ) ) + 7 ) , 0 ) . n ( ) ) #NEWLINE# sol = list ( solveset_complex ( ( ( ( x ** 6 ) - ( 2 * x ) ) + 2 ) , x ) ) #NEWLINE# assert ( all ( ( isinstance ( i , CRootOf ) for i in sol ) ) and ( len ( sol ) == 6 ) ) #NEWLINE# f = ( ( ( ( ( x ** 5 ) - ( 15 * ( x ** 3 ) ) ) - ( 5 * ( x ** 2 ) ) ) + ( 10 * x ) ) + 20 ) #NEWLINE# s = list ( solveset_complex ( f , x ) ) #NEWLINE# for root in s : #NEWLINE# #INDENT# assert ( root . func == CRootOf ) #NEWLINE# #UNINDENT# s = ( ( ( ( x ** 5 ) + ( 4 * ( x ** 3 ) ) ) + ( 3 * ( x ** 2 ) ) ) + ( S ( 7 ) / 4 ) ) #NEWLINE# assert ( solveset_complex ( s , x ) == FiniteSet ( * Poly ( ( s * 4 ) , domain = 'ZZ' ) . all_roots ( ) ) ) #NEWLINE# eq = ( ( ( x * ( ( x - 1 ) ** 2 ) ) * ( x + 1 ) ) * ( ( ( x ** 6 ) - x ) + 1 ) ) #NEWLINE# assert ( solveset_complex ( eq , x ) == FiniteSet ( ( - 1 ) , 0 , 1 , CRootOf ( ( ( ( x ** 6 ) - x ) + 1 ) , 0 ) , CRootOf ( ( ( ( x ** 6 ) - x ) + 1 ) , 1 ) , CRootOf ( ( ( ( x ** 6 ) - x ) + 1 ) , 2 ) , CRootOf ( ( ( ( x ** 6 ) - x ) + 1 ) , 3 ) , CRootOf ( ( ( ( x ** 6 ) - x ) + 1 ) , 4 ) , CRootOf ( ( ( ( x ** 6 ) - x ) + 1 ) , 5 ) ) )