#NEWLINE# def test_modified_subresultants_amv( ) : #NEWLINE# #INDENT# x = var ( 'x' ) #NEWLINE# p = ( ( ( ( ( ( ( x ** 8 ) + ( x ** 6 ) ) - ( 3 * ( x ** 4 ) ) ) - ( 3 * ( x ** 3 ) ) ) + ( 8 * ( x ** 2 ) ) ) + ( 2 * x ) ) - 5 ) #NEWLINE# q = ( ( ( ( ( 3 * ( x ** 6 ) ) + ( 5 * ( x ** 4 ) ) ) - ( 4 * ( x ** 2 ) ) ) - ( 9 * x ) ) + 21 ) #NEWLINE# amv_factors = [ 1 , 1 , ( - 1 ) , 1 , ( - 1 ) , 1 ] #NEWLINE# assert ( modified_subresultants_amv ( p , q , x ) == [ ( i * j ) for ( i , j ) in zip ( amv_factors , subresultants_amv ( p , q , x ) ) ] ) #NEWLINE# assert ( modified_subresultants_amv ( p , q , x ) [ ( - 1 ) ] != sylvester ( ( p + ( x ** 8 ) ) , q , x ) . det ( ) ) #NEWLINE# assert ( modified_subresultants_amv ( p , q , x ) != sturm_amv ( p , q , x ) ) #NEWLINE# p = ( ( ( x ** 3 ) - ( 7 * x ) ) + 7 ) #NEWLINE# q = ( ( 3 * ( x ** 2 ) ) - 7 ) #NEWLINE# assert ( modified_subresultants_amv ( p , q , x ) == sturm_amv ( p , q , x ) ) #NEWLINE# assert ( modified_subresultants_amv ( ( - p ) , q , x ) != sturm_amv ( ( - p ) , q , x ) )