<s> """<STR_LIT>""" <EOL> from sympy import S , sqrt , sin , oo , Poly , Float <EOL> from sympy . abc import x , y , z <EOL> from sympy . polys . domains import ZZ , QQ , RR , CC , FF , GF , EX <EOL> from sympy . polys . domains . realfield import RealField <EOL> from sympy . polys . rings import ring <EOL> from sympy . polys . fields import field <EOL> from sympy . polys . polyerrors import ( <EOL> UnificationFailed , <EOL> GeneratorsNeeded , <EOL> GeneratorsError , <EOL> CoercionFailed , <EOL> NotInvertible , <EOL> DomainError ) <EOL> from sympy . utilities . pytest import raises <EOL> ALG = QQ . algebraic_field ( sqrt ( <NUM_LIT:2> ) , sqrt ( <NUM_LIT:3> ) ) <EOL> def unify ( K0 , K1 ) : <EOL> return K0 . unify ( K1 ) <EOL> def test_Domain_unify ( ) : <EOL> F3 = GF ( <NUM_LIT:3> ) <EOL> assert unify ( F3 , F3 ) == F3 <EOL> assert unify ( F3 , ZZ ) == ZZ <EOL> assert unify ( F3 , QQ ) == QQ <EOL> assert unify ( F3 , ALG ) == ALG <EOL> assert unify ( F3 , RR ) == RR <EOL> assert unify ( F3 , CC ) == CC <EOL> assert unify ( F3 , ZZ [ x ] ) == ZZ [ x ] <EOL> assert unify ( F3 , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( F3 , EX ) == EX <EOL> assert unify ( ZZ , F3 ) == ZZ <EOL> assert unify ( ZZ , ZZ ) == ZZ <EOL> assert unify ( ZZ , QQ ) == QQ <EOL> assert unify ( ZZ , ALG ) == ALG <EOL> assert unify ( ZZ , RR ) == RR <EOL> assert unify ( ZZ , CC ) == CC <EOL> assert unify ( ZZ , ZZ [ x ] ) == ZZ [ x ] <EOL> assert unify ( ZZ , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ , EX ) == EX <EOL> assert unify ( QQ , F3 ) == QQ <EOL> assert unify ( QQ , ZZ ) == QQ <EOL> assert unify ( QQ , QQ ) == QQ <EOL> assert unify ( QQ , ALG ) == ALG <EOL> assert unify ( QQ , RR ) == RR <EOL> assert unify ( QQ , CC ) == CC <EOL> assert unify ( QQ , ZZ [ x ] ) == QQ [ x ] <EOL> assert unify ( QQ , ZZ . frac_field ( x ) ) == QQ . frac_field ( x ) <EOL> assert unify ( QQ , EX ) == EX <EOL> assert unify ( RR , F3 ) == RR <EOL> assert unify ( RR , ZZ ) == RR <EOL> assert unify ( RR , QQ ) == RR <EOL> assert unify ( RR , ALG ) == RR <EOL> assert unify ( RR , RR ) == RR <EOL> assert unify ( RR , CC ) == CC <EOL> assert unify ( RR , ZZ [ x ] ) == RR [ x ] <EOL> assert unify ( RR , ZZ . frac_field ( x ) ) == RR . frac_field ( x ) <EOL> assert unify ( RR , EX ) == EX <EOL> assert RR [ x ] . unify ( ZZ . frac_field ( y ) ) == RR . frac_field ( x , y ) <EOL> assert unify ( CC , F3 ) == CC <EOL> assert unify ( CC , ZZ ) == CC <EOL> assert unify ( CC , QQ ) == CC <EOL> assert unify ( CC , ALG ) == CC <EOL> assert unify ( CC , RR ) == CC <EOL> assert unify ( CC , CC ) == CC <EOL> assert unify ( CC , ZZ [ x ] ) == CC [ x ] <EOL> assert unify ( CC , ZZ . frac_field ( x ) ) == CC . frac_field ( x ) <EOL> assert unify ( CC , EX ) == EX <EOL> assert unify ( ZZ [ x ] , F3 ) == ZZ [ x ] <EOL> assert unify ( ZZ [ x ] , ZZ ) == ZZ [ x ] <EOL> assert unify ( ZZ [ x ] , QQ ) == QQ [ x ] <EOL> assert unify ( ZZ [ x ] , ALG ) == ALG [ x ] <EOL> assert unify ( ZZ [ x ] , RR ) == RR [ x ] <EOL> assert unify ( ZZ [ x ] , CC ) == CC [ x ] <EOL> assert unify ( ZZ [ x ] , ZZ [ x ] ) == ZZ [ x ] <EOL> assert unify ( ZZ [ x ] , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ [ x ] , EX ) == EX <EOL> assert unify ( ZZ . frac_field ( x ) , F3 ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , ZZ ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , QQ ) == QQ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , ALG ) == ALG . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , RR ) == RR . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , CC ) == CC . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , ZZ [ x ] ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , EX ) == EX <EOL> assert unify ( EX , F3 ) == EX <EOL> assert unify ( EX , ZZ ) == EX <EOL> assert unify ( EX , QQ ) == EX <EOL> assert unify ( EX , ALG ) == EX <EOL> assert unify ( EX , RR ) == EX <EOL> assert unify ( EX , CC ) == EX <EOL> assert unify ( EX , ZZ [ x ] ) == EX <EOL> assert unify ( EX , ZZ . frac_field ( x ) ) == EX <EOL> assert unify ( EX , EX ) == EX <EOL> def test_Domain_unify_composite ( ) : <EOL> assert unify ( ZZ . poly_ring ( x ) , ZZ ) == ZZ . poly_ring ( x ) <EOL> assert unify ( ZZ . poly_ring ( x ) , QQ ) == QQ . poly_ring ( x ) <EOL> assert unify ( QQ . poly_ring ( x ) , ZZ ) == QQ . poly_ring ( x ) <EOL> assert unify ( QQ . poly_ring ( x ) , QQ ) == QQ . poly_ring ( x ) <EOL> assert unify ( ZZ , ZZ . poly_ring ( x ) ) == ZZ . poly_ring ( x ) <EOL> assert unify ( QQ , ZZ . poly_ring ( x ) ) == QQ . poly_ring ( x ) <EOL> assert unify ( ZZ , QQ . poly_ring ( x ) ) == QQ . poly_ring ( x ) <EOL> assert unify ( QQ , QQ . poly_ring ( x ) ) == QQ . poly_ring ( x ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , ZZ ) == ZZ . poly_ring ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , QQ ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , ZZ ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , QQ ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( ZZ , ZZ . poly_ring ( x , y ) ) == ZZ . poly_ring ( x , y ) <EOL> assert unify ( QQ , ZZ . poly_ring ( x , y ) ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( ZZ , QQ . poly_ring ( x , y ) ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( QQ , QQ . poly_ring ( x , y ) ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x ) , ZZ ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , QQ ) == QQ . frac_field ( x ) <EOL> assert unify ( QQ . frac_field ( x ) , ZZ ) == QQ . frac_field ( x ) <EOL> assert unify ( QQ . frac_field ( x ) , QQ ) == QQ . frac_field ( x ) <EOL> assert unify ( ZZ , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( QQ , ZZ . frac_field ( x ) ) == QQ . frac_field ( x ) <EOL> assert unify ( ZZ , QQ . frac_field ( x ) ) == QQ . frac_field ( x ) <EOL> assert unify ( QQ , QQ . frac_field ( x ) ) == QQ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , ZZ ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , QQ ) == QQ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x , y ) , ZZ ) == QQ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x , y ) , QQ ) == QQ . frac_field ( x , y ) <EOL> assert unify ( ZZ , ZZ . frac_field ( x , y ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( QQ , ZZ . frac_field ( x , y ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( ZZ , QQ . frac_field ( x , y ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( QQ , QQ . frac_field ( x , y ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x ) , ZZ . poly_ring ( x ) ) == ZZ . poly_ring ( x ) <EOL> assert unify ( ZZ . poly_ring ( x ) , QQ . poly_ring ( x ) ) == QQ . poly_ring ( x ) <EOL> assert unify ( QQ . poly_ring ( x ) , ZZ . poly_ring ( x ) ) == QQ . poly_ring ( x ) <EOL> assert unify ( QQ . poly_ring ( x ) , QQ . poly_ring ( x ) ) == QQ . poly_ring ( x ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , ZZ . poly_ring ( x ) ) == ZZ . poly_ring ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , QQ . poly_ring ( x ) ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , ZZ . poly_ring ( x ) ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , QQ . poly_ring ( x ) ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x ) , ZZ . poly_ring ( x , y ) ) == ZZ . poly_ring ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x ) , QQ . poly_ring ( x , y ) ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x ) , ZZ . poly_ring ( x , y ) ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x ) , QQ . poly_ring ( x , y ) ) == QQ . poly_ring ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , ZZ . poly_ring ( x , z ) ) == ZZ . poly_ring ( x , y , z ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , QQ . poly_ring ( x , z ) ) == QQ . poly_ring ( x , y , z ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , ZZ . poly_ring ( x , z ) ) == QQ . poly_ring ( x , y , z ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , QQ . poly_ring ( x , z ) ) == QQ . poly_ring ( x , y , z ) <EOL> assert unify ( ZZ . frac_field ( x ) , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , QQ . frac_field ( x ) ) == QQ . frac_field ( x ) <EOL> assert unify ( QQ . frac_field ( x ) , ZZ . frac_field ( x ) ) == QQ . frac_field ( x ) <EOL> assert unify ( QQ . frac_field ( x ) , QQ . frac_field ( x ) ) == QQ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , QQ . frac_field ( x ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x , y ) , ZZ . frac_field ( x ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x , y ) , QQ . frac_field ( x ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x ) , ZZ . frac_field ( x , y ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x ) , QQ . frac_field ( x , y ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x ) , ZZ . frac_field ( x , y ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x ) , QQ . frac_field ( x , y ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , ZZ . frac_field ( x , z ) ) == ZZ . frac_field ( x , y , z ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , QQ . frac_field ( x , z ) ) == QQ . frac_field ( x , y , z ) <EOL> assert unify ( QQ . frac_field ( x , y ) , ZZ . frac_field ( x , z ) ) == QQ . frac_field ( x , y , z ) <EOL> assert unify ( QQ . frac_field ( x , y ) , QQ . frac_field ( x , z ) ) == QQ . frac_field ( x , y , z ) <EOL> assert unify ( ZZ . poly_ring ( x ) , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ . poly_ring ( x ) , QQ . frac_field ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( QQ . poly_ring ( x ) , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( QQ . poly_ring ( x ) , QQ . frac_field ( x ) ) == QQ . frac_field ( x ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , QQ . frac_field ( x ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , ZZ . frac_field ( x ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , QQ . frac_field ( x ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x ) , ZZ . frac_field ( x , y ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x ) , QQ . frac_field ( x , y ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x ) , ZZ . frac_field ( x , y ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( QQ . poly_ring ( x ) , QQ . frac_field ( x , y ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , ZZ . frac_field ( x , z ) ) == ZZ . frac_field ( x , y , z ) <EOL> assert unify ( ZZ . poly_ring ( x , y ) , QQ . frac_field ( x , z ) ) == ZZ . frac_field ( x , y , z ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , ZZ . frac_field ( x , z ) ) == ZZ . frac_field ( x , y , z ) <EOL> assert unify ( QQ . poly_ring ( x , y ) , QQ . frac_field ( x , z ) ) == QQ . frac_field ( x , y , z ) <EOL> assert unify ( ZZ . frac_field ( x ) , ZZ . poly_ring ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x ) , QQ . poly_ring ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( QQ . frac_field ( x ) , ZZ . poly_ring ( x ) ) == ZZ . frac_field ( x ) <EOL> assert unify ( QQ . frac_field ( x ) , QQ . poly_ring ( x ) ) == QQ . frac_field ( x ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , ZZ . poly_ring ( x ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , QQ . poly_ring ( x ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x , y ) , ZZ . poly_ring ( x ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x , y ) , QQ . poly_ring ( x ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x ) , ZZ . poly_ring ( x , y ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x ) , QQ . poly_ring ( x , y ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x ) , ZZ . poly_ring ( x , y ) ) == ZZ . frac_field ( x , y ) <EOL> assert unify ( QQ . frac_field ( x ) , QQ . poly_ring ( x , y ) ) == QQ . frac_field ( x , y ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , ZZ . poly_ring ( x , z ) ) == ZZ . frac_field ( x , y , z ) <EOL> assert unify ( ZZ . frac_field ( x , y ) , QQ . poly_ring ( x , z ) ) == ZZ . frac_field ( x , y , z ) <EOL> assert unify ( QQ . frac_field ( x , y ) , ZZ . poly_ring ( x , z ) ) == ZZ . frac_field ( x , y , z ) <EOL> assert unify ( QQ . frac_field ( x , y ) , QQ . poly_ring ( x , z ) ) == QQ . frac_field ( x , y , z ) <EOL> def test_Domain_unify_algebraic ( ) : <EOL> sqrt5 = QQ . algebraic_field ( sqrt ( <NUM_LIT:5> ) ) <EOL> sqrt7 = QQ . algebraic_field ( sqrt ( <NUM_LIT:7> ) ) <EOL> sqrt57 = QQ . algebraic_field ( sqrt ( <NUM_LIT:5> ) , sqrt ( <NUM_LIT:7> ) ) <EOL> assert sqrt5 . unify ( sqrt7 ) == sqrt57 <EOL> assert sqrt5 . unify ( sqrt5 [ x , y ] ) == sqrt5 [ x , y ] <EOL> assert sqrt5 [ x , y ] . unify ( sqrt5 ) == sqrt5 [ x , y ] <EOL> assert sqrt5 . unify ( sqrt5 . frac_field ( x , y ) ) == sqrt5 . frac_field ( x , y ) <EOL> assert sqrt5 . frac_field ( x , y ) . unify ( sqrt5 ) == sqrt5 . frac_field ( x , y ) <EOL> assert sqrt5 . unify ( sqrt7 [ x , y ] ) == sqrt57 [ x , y ] <EOL> assert sqrt5 [ x , y ] . unify ( sqrt7 ) == sqrt57 [ x , y ] <EOL> assert sqrt5 . unify ( sqrt7 . frac_field ( x , y ) ) == sqrt57 . frac_field ( x , y ) <EOL> assert sqrt5 . frac_field ( x , y ) . unify ( sqrt7 ) == sqrt57 . frac_field ( x , y ) <EOL> def test_Domain_unify_with_symbols ( ) : <EOL> raises ( UnificationFailed , lambda : ZZ [ x , y ] . unify_with_symbols ( ZZ , ( y , z ) ) ) <EOL> raises ( UnificationFailed , lambda : ZZ . unify_with_symbols ( ZZ [ x , y ] , ( y , z ) ) ) <EOL> def test_Domain__contains__ ( ) : <EOL> assert ( <NUM_LIT:0> in EX ) is True <EOL> assert ( <NUM_LIT:0> in ZZ ) is True <EOL> assert ( <NUM_LIT:0> in QQ ) is True <EOL> assert ( <NUM_LIT:0> in RR ) is True <EOL> assert ( <NUM_LIT:0> in CC ) is True <EOL> assert ( <NUM_LIT:0> in ALG ) is True <EOL> assert ( <NUM_LIT:0> in ZZ [ x , y ] ) is True <EOL> assert ( <NUM_LIT:0> in QQ [ x , y ] ) is True <EOL> assert ( <NUM_LIT:0> in RR [ x , y ] ) is True <EOL> assert ( - <NUM_LIT:7> in EX ) is True <EOL> assert ( - <NUM_LIT:7> in ZZ ) is True <EOL> assert ( - <NUM_LIT:7> in QQ ) is True <EOL> assert ( - <NUM_LIT:7> in RR ) is True <EOL> assert ( - <NUM_LIT:7> in CC ) is True <EOL> assert ( - <NUM_LIT:7> in ALG ) is True <EOL> assert ( - <NUM_LIT:7> in ZZ [ x , y ] ) is True <EOL> assert ( - <NUM_LIT:7> in QQ [ x , y ] ) is True <EOL> assert ( - <NUM_LIT:7> in RR [ x , y ] ) is True <EOL> assert ( <NUM_LIT> in EX ) is True <EOL> assert ( <NUM_LIT> in ZZ ) is True <EOL> assert ( <NUM_LIT> in QQ ) is True <EOL> assert ( <NUM_LIT> in RR ) is True <EOL> assert ( <NUM_LIT> in CC ) is True <EOL> assert ( <NUM_LIT> in ALG ) is True <EOL> assert ( <NUM_LIT> in ZZ [ x , y ] ) is True <EOL> assert ( <NUM_LIT> in QQ [ x , y ] ) is True <EOL> assert ( <NUM_LIT> in RR [ x , y ] ) is True <EOL> assert ( - S ( <NUM_LIT:1> ) / <NUM_LIT:7> in EX ) is True <EOL> assert ( - S ( <NUM_LIT:1> ) / <NUM_LIT:7> in ZZ ) is False <EOL> assert ( - S ( <NUM_LIT:1> ) / <NUM_LIT:7> in QQ ) is True <EOL> assert ( - S ( <NUM_LIT:1> ) / <NUM_LIT:7> in RR ) is True <EOL> assert ( - S ( <NUM_LIT:1> ) / <NUM_LIT:7> in CC ) is True <EOL> assert ( - S ( <NUM_LIT:1> ) / <NUM_LIT:7> in ALG ) is True <EOL> assert ( - S ( <NUM_LIT:1> ) / <NUM_LIT:7> in ZZ [ x , y ] ) is False <EOL> assert ( - S ( <NUM_LIT:1> ) / <NUM_LIT:7> in QQ [ x , y ] ) is True <EOL> assert ( - S ( <NUM_LIT:1> ) / <NUM_LIT:7> in RR [ x , y ] ) is True <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:5> in EX ) is True <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:5> in ZZ ) is False <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:5> in QQ ) is True <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:5> in RR ) is True <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:5> in CC ) is True <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:5> in ALG ) is True <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:5> in ZZ [ x , y ] ) is False <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:5> in QQ [ x , y ] ) is True <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:5> in RR [ x , y ] ) is True <EOL> assert ( <NUM_LIT> in EX ) is True <EOL> assert ( <NUM_LIT> in ZZ ) is True <EOL> assert ( <NUM_LIT> in QQ ) is True <EOL> assert ( <NUM_LIT> in RR ) is True <EOL> assert ( <NUM_LIT> in CC ) is True <EOL> assert ( <NUM_LIT> in ALG ) is True <EOL> assert ( <NUM_LIT> in ZZ [ x , y ] ) is True <EOL> assert ( <NUM_LIT> in QQ [ x , y ] ) is True <EOL> assert ( <NUM_LIT> in RR [ x , y ] ) is True <EOL> assert ( <NUM_LIT> in EX ) is True <EOL> assert ( <NUM_LIT> in ZZ ) is False <EOL> assert ( <NUM_LIT> in QQ ) is True <EOL> assert ( <NUM_LIT> in RR ) is True <EOL> assert ( <NUM_LIT> in CC ) is True <EOL> assert ( <NUM_LIT> in ALG ) is True <EOL> assert ( <NUM_LIT> in ZZ [ x , y ] ) is False <EOL> assert ( <NUM_LIT> in QQ [ x , y ] ) is True <EOL> assert ( <NUM_LIT> in RR [ x , y ] ) is True <EOL> assert ( oo in EX ) is True <EOL> assert ( oo in ZZ ) is False <EOL> assert ( oo in QQ ) is False <EOL> assert ( oo in RR ) is True <EOL> assert ( oo in CC ) is True <EOL> assert ( oo in ALG ) is False <EOL> assert ( oo in ZZ [ x , y ] ) is False <EOL> assert ( oo in QQ [ x , y ] ) is False <EOL> assert ( oo in RR [ x , y ] ) is True <EOL> assert ( - oo in EX ) is True <EOL> assert ( - oo in ZZ ) is False <EOL> assert ( - oo in QQ ) is False <EOL> assert ( - oo in RR ) is True <EOL> assert ( - oo in CC ) is True <EOL> assert ( - oo in ALG ) is False <EOL> assert ( - oo in ZZ [ x , y ] ) is False <EOL> assert ( - oo in QQ [ x , y ] ) is False <EOL> assert ( - oo in RR [ x , y ] ) is True <EOL> assert ( sqrt ( <NUM_LIT:7> ) in EX ) is True <EOL> assert ( sqrt ( <NUM_LIT:7> ) in ZZ ) is False <EOL> assert ( sqrt ( <NUM_LIT:7> ) in QQ ) is False <EOL> assert ( sqrt ( <NUM_LIT:7> ) in RR ) is True <EOL> assert ( sqrt ( <NUM_LIT:7> ) in CC ) is True <EOL> assert ( sqrt ( <NUM_LIT:7> ) in ALG ) is False <EOL> assert ( sqrt ( <NUM_LIT:7> ) in ZZ [ x , y ] ) is False <EOL> assert ( sqrt ( <NUM_LIT:7> ) in QQ [ x , y ] ) is False <EOL> assert ( sqrt ( <NUM_LIT:7> ) in RR [ x , y ] ) is True <EOL> assert ( <NUM_LIT:2> * sqrt ( <NUM_LIT:3> ) + <NUM_LIT:1> in EX ) is True <EOL> assert ( <NUM_LIT:2> * sqrt ( <NUM_LIT:3> ) + <NUM_LIT:1> in ZZ ) is False <EOL> assert ( <NUM_LIT:2> * sqrt ( <NUM_LIT:3> ) + <NUM_LIT:1> in QQ ) is False <EOL> assert ( <NUM_LIT:2> * sqrt ( <NUM_LIT:3> ) + <NUM_LIT:1> in RR ) is True <EOL> assert ( <NUM_LIT:2> * sqrt ( <NUM_LIT:3> ) + <NUM_LIT:1> in CC ) is True <EOL> assert ( <NUM_LIT:2> * sqrt ( <NUM_LIT:3> ) + <NUM_LIT:1> in ALG ) is True <EOL> assert ( <NUM_LIT:2> * sqrt ( <NUM_LIT:3> ) + <NUM_LIT:1> in ZZ [ x , y ] ) is False <EOL> assert ( <NUM_LIT:2> * sqrt ( <NUM_LIT:3> ) + <NUM_LIT:1> in QQ [ x , y ] ) is False <EOL> assert ( <NUM_LIT:2> * sqrt ( <NUM_LIT:3> ) + <NUM_LIT:1> in RR [ x , y ] ) is True <EOL> assert ( sin ( <NUM_LIT:1> ) in EX ) is True <EOL> assert ( sin ( <NUM_LIT:1> ) in ZZ ) is False <EOL> assert ( sin ( <NUM_LIT:1> ) in QQ ) is False <EOL> assert ( sin ( <NUM_LIT:1> ) in RR ) is True <EOL> assert ( sin ( <NUM_LIT:1> ) in CC ) is True <EOL> assert ( sin ( <NUM_LIT:1> ) in ALG ) is False <EOL> assert ( sin ( <NUM_LIT:1> ) in ZZ [ x , y ] ) is False <EOL> assert ( sin ( <NUM_LIT:1> ) in QQ [ x , y ] ) is False <EOL> assert ( sin ( <NUM_LIT:1> ) in RR [ x , y ] ) is True <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in EX ) is True <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in ZZ ) is False <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in QQ ) is False <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in RR ) is False <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in CC ) is False <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in ALG ) is False <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in ZZ [ x ] ) is True <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in QQ [ x ] ) is True <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in RR [ x ] ) is True <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in ZZ [ x , y ] ) is True <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in QQ [ x , y ] ) is True <EOL> assert ( x ** <NUM_LIT:2> + <NUM_LIT:1> in RR [ x , y ] ) is True <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in EX ) is True <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in ZZ ) is False <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in QQ ) is False <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in RR ) is False <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in CC ) is False <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in ALG ) is False <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in ZZ [ x ] ) is False <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in QQ [ x ] ) is False <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in RR [ x ] ) is False <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in ZZ [ x , y ] ) is True <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in QQ [ x , y ] ) is True <EOL> assert ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> in RR [ x , y ] ) is True <EOL> assert ( S ( <NUM_LIT:3> ) / <NUM_LIT:2> * x / ( y + <NUM_LIT:1> ) - z in QQ [ x , y , z ] ) is False <EOL> def test_Domain_get_ring ( ) : <EOL> assert ZZ . has_assoc_Ring is True <EOL> assert QQ . has_assoc_Ring is True <EOL> assert ZZ [ x ] . has_assoc_Ring is True <EOL> assert QQ [ x ] . has_assoc_Ring is True <EOL> assert ZZ [ x , y ] . has_assoc_Ring is True <EOL> assert QQ [ x , y ] . has_assoc_Ring is True <EOL> assert ZZ . frac_field ( x ) . has_assoc_Ring is True <EOL> assert QQ . frac_field ( x ) . has_assoc_Ring is True <EOL> assert ZZ . frac_field ( x , y ) . has_assoc_Ring is True <EOL> assert QQ . frac_field ( x , y ) . has_assoc_Ring is True <EOL> assert EX . has_assoc_Ring is False <EOL> assert RR . has_assoc_Ring is False <EOL> assert ALG . has_assoc_Ring is False <EOL> assert ZZ . get_ring ( ) == ZZ <EOL> assert QQ . get_ring ( ) == ZZ <EOL> assert ZZ [ x ] . get_ring ( ) == ZZ [ x ] <EOL> assert QQ [ x ] . get_ring ( ) == QQ [ x ] <EOL> assert ZZ [ x , y ] . get_ring ( ) == ZZ [ x , y ] <EOL> assert QQ [ x , y ] . get_ring ( ) == QQ [ x , y ] <EOL> assert ZZ . frac_field ( x ) . get_ring ( ) == ZZ [ x ] <EOL> assert QQ . frac_field ( x ) . get_ring ( ) == QQ [ x ] <EOL> assert ZZ . frac_field ( x , y ) . get_ring ( ) == ZZ [ x , y ] <EOL> assert QQ . frac_field ( x , y ) . get_ring ( ) == QQ [ x , y ] <EOL> assert EX . get_ring ( ) == EX <EOL> assert RR . get_ring ( ) == RR <EOL> raises ( DomainError , lambda : ALG . get_ring ( ) ) <EOL> def test_Domain_get_field ( ) : <EOL> assert EX . has_assoc_Field is True <EOL> assert ZZ . has_assoc_Field is True <EOL> assert QQ . has_assoc_Field is True <EOL> assert RR . has_assoc_Field is True <EOL> assert ALG . has_assoc_Field is True <EOL> assert ZZ [ x ] . has_assoc_Field is True <EOL> assert QQ [ x ] . has_assoc_Field is True <EOL> assert ZZ [ x , y ] . has_assoc_Field is True <EOL> assert QQ [ x , y ] . has_assoc_Field is True <EOL> assert EX . get_field ( ) == EX <EOL> assert ZZ . get_field ( ) == QQ <EOL> assert QQ . get_field ( ) == QQ <EOL> assert RR . get_field ( ) == RR <EOL> assert ALG . get_field ( ) == ALG <EOL> assert ZZ [ x ] . get_field ( ) == ZZ . frac_field ( x ) <EOL> assert QQ [ x ] . get_field ( ) == QQ . frac_field ( x ) <EOL> assert ZZ [ x , y ] . get_field ( ) == ZZ . frac_field ( x , y ) <EOL> assert QQ [ x , y ] . get_field ( ) == QQ . frac_field ( x , y ) <EOL> def test_Domain_get_exact ( ) : <EOL> assert EX . get_exact ( ) == EX <EOL> assert ZZ . get_exact ( ) == ZZ <EOL> assert QQ . get_exact ( ) == QQ <EOL> assert RR . get_exact ( ) == QQ <EOL> assert ALG . get_exact ( ) == ALG <EOL> assert ZZ [ x ] . get_exact ( ) == ZZ [ x ] <EOL> assert QQ [ x ] . get_exact ( ) == QQ [ x ] <EOL> assert ZZ [ x , y ] . get_exact ( ) == ZZ [ x , y ] <EOL> assert QQ [ x , y ] . get_exact ( ) == QQ [ x , y ] <EOL> assert ZZ . frac_field ( x ) . get_exact ( ) == ZZ . frac_field ( x ) <EOL> assert QQ . frac_field ( x ) . get_exact ( ) == QQ . frac_field ( x ) <EOL> assert ZZ . frac_field ( x , y ) . get_exact ( ) == ZZ . frac_field ( x , y ) <EOL> assert QQ . frac_field ( x , y ) . get_exact ( ) == QQ . frac_field ( x , y ) <EOL> def test_Domain_convert ( ) : <EOL> assert QQ . convert ( <NUM_LIT> ) == QQ ( <NUM_LIT> , <NUM_LIT> ) <EOL> R , x = ring ( "<STR_LIT:x>" , ZZ ) <EOL> assert ZZ . convert ( x - x ) == <NUM_LIT:0> <EOL> assert ZZ . convert ( x - x , R . to_domain ( ) ) == <NUM_LIT:0> <EOL> def test_PolynomialRing__init ( ) : <EOL> raises ( GeneratorsNeeded , lambda : ZZ . poly_ring ( ) ) <EOL> def test_FractionField__init ( ) : <EOL> raises ( GeneratorsNeeded , lambda : ZZ . frac_field ( ) ) <EOL> def test_inject ( ) : <EOL> assert ZZ . inject ( x , y , z ) == ZZ [ x , y , z ] <EOL> assert ZZ [ x ] . inject ( y , z ) == ZZ [ x , y , z ] <EOL> assert ZZ . frac_field ( x ) . inject ( y , z ) == ZZ . frac_field ( x , y , z ) <EOL> raises ( GeneratorsError , lambda : ZZ [ x ] . inject ( x ) ) <EOL> def test_Domain_map ( ) : <EOL> seq = ZZ . map ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] ) <EOL> assert all ( ZZ . of_type ( elt ) for elt in seq ) <EOL> seq = ZZ . map ( [ [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] ] ) <EOL> assert all ( ZZ . of_type ( elt ) for elt in seq [ <NUM_LIT:0> ] ) and len ( seq ) == <NUM_LIT:1> <EOL> def test_Domain___eq__ ( ) : <EOL> assert ( ZZ [ x , y ] == ZZ [ x , y ] ) is True <EOL> assert ( QQ [ x , y ] == QQ [ x , y ] ) is True <EOL> assert ( ZZ [ x , y ] == QQ [ x , y ] ) is False <EOL> assert ( QQ [ x , y ] == ZZ [ x , y ] ) is False <EOL> assert ( ZZ . frac_field ( x , y ) == ZZ . frac_field ( x , y ) ) is True <EOL> assert ( QQ . frac_field ( x , y ) == QQ . frac_field ( x , y ) ) is True <EOL> assert ( ZZ . frac_field ( x , y ) == QQ . frac_field ( x , y ) ) is False <EOL> assert ( QQ . frac_field ( x , y ) == ZZ . frac_field ( x , y ) ) is False <EOL> def test_Domain__algebraic_field ( ) : <EOL> alg = ZZ . algebraic_field ( sqrt ( <NUM_LIT:2> ) ) <EOL> assert alg . ext . minpoly == Poly ( x ** <NUM_LIT:2> - <NUM_LIT:2> ) <EOL> assert alg . dom == QQ <EOL> alg = QQ . algebraic_field ( sqrt ( <NUM_LIT:2> ) ) <EOL> assert alg . ext . minpoly == Poly ( x ** <NUM_LIT:2> - <NUM_LIT:2> ) <EOL> assert alg . dom == QQ <EOL> alg = alg . algebraic_field ( sqrt ( <NUM_LIT:3> ) ) <EOL> assert alg . ext . minpoly == Poly ( x ** <NUM_LIT:4> - <NUM_LIT:10> * x ** <NUM_LIT:2> + <NUM_LIT:1> ) <EOL> assert alg . dom == QQ <EOL> def test_PolynomialRing_from_FractionField ( ) : <EOL> F , x , y = field ( "<STR_LIT>" , ZZ ) <EOL> R , X , Y = ring ( "<STR_LIT>" , ZZ ) <EOL> f = ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> ) / ( x + <NUM_LIT:1> ) <EOL> g = ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> ) / <NUM_LIT:4> <EOL> h = x ** <NUM_LIT:2> + y ** <NUM_LIT:2> <EOL> assert R . to_domain ( ) . from_FractionField ( f , F . to_domain ( ) ) is None <EOL> assert R . to_domain ( ) . from_FractionField ( g , F . to_domain ( ) ) == X ** <NUM_LIT:2> / <NUM_LIT:4> + Y ** <NUM_LIT:2> / <NUM_LIT:4> <EOL> assert R . to_domain ( ) . from_FractionField ( h , F . to_domain ( ) ) == X ** <NUM_LIT:2> + Y ** <NUM_LIT:2> <EOL> F , x , y = field ( "<STR_LIT>" , QQ ) <EOL> R , X , Y = ring ( "<STR_LIT>" , QQ ) <EOL> f = ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> ) / ( x + <NUM_LIT:1> ) <EOL> g = ( x ** <NUM_LIT:2> + y ** <NUM_LIT:2> ) / <NUM_LIT:4> <EOL> h = x ** <NUM_LIT:2> + y ** <NUM_LIT:2> <EOL> assert R . to_domain ( ) . from_FractionField ( f , F . to_domain ( ) ) is None <EOL> assert R . to_domain ( ) . from_FractionField ( g , F . to_domain ( ) ) == X ** <NUM_LIT:2> / <NUM_LIT:4> + Y ** <NUM_LIT:2> / <NUM_LIT:4> <EOL> assert R . to_domain ( ) . from_FractionField ( h , F . to_domain ( ) ) == X ** <NUM_LIT:2> + Y ** <NUM_LIT:2> <EOL> def test_FractionField_from_PolynomialRing ( ) : <EOL> R , x , y = ring ( "<STR_LIT>" , QQ ) <EOL> F , X , Y = field ( "<STR_LIT>" , ZZ ) <EOL> f = <NUM_LIT:3> * x ** <NUM_LIT:2> + <NUM_LIT:5> * y ** <NUM_LIT:2> <EOL> g = x ** <NUM_LIT:2> / <NUM_LIT:3> + y ** <NUM_LIT:2> / <NUM_LIT:5> <EOL> assert F . to_domain ( ) . from_PolynomialRing ( f , R . to_domain ( ) ) == <NUM_LIT:3> * X ** <NUM_LIT:2> + <NUM_LIT:5> * Y ** <NUM_LIT:2> <EOL> assert F . to_domain ( ) . from_PolynomialRing ( g , R . to_domain ( ) ) == ( <NUM_LIT:5> * X ** <NUM_LIT:2> + <NUM_LIT:3> * Y ** <NUM_LIT:2> ) / <NUM_LIT:15> <EOL> def test_FF_of_type ( ) : <EOL> assert FF ( <NUM_LIT:3> ) . of_type ( FF ( <NUM_LIT:3> ) ( <NUM_LIT:1> ) ) is True <EOL> assert FF ( <NUM_LIT:5> ) . of_type ( FF ( <NUM_LIT:5> ) ( <NUM_LIT:3> ) ) is True <EOL> assert FF ( <NUM_LIT:5> ) . of_type ( FF ( <NUM_LIT:7> ) ( <NUM_LIT:3> ) ) is False <EOL> def test___eq__ ( ) : <EOL> assert not QQ [ x ] == ZZ [ x ] <EOL> assert not QQ . frac_field ( x ) == ZZ . frac_field ( x ) <EOL> def test_RealField_from_sympy ( ) : <EOL> assert RR . convert ( S ( <NUM_LIT:0> ) ) == RR . dtype ( <NUM_LIT:0> ) <EOL> assert RR . convert ( S ( <NUM_LIT:0.0> ) ) == RR . dtype ( <NUM_LIT:0.0> ) <EOL> assert RR . convert ( S ( <NUM_LIT:1> ) ) == RR . dtype ( <NUM_LIT:1> ) <EOL> assert RR . convert ( S ( <NUM_LIT:1.0> ) ) == RR . dtype ( <NUM_LIT:1.0> ) <EOL> assert RR . convert ( sin ( <NUM_LIT:1> ) ) == RR . dtype ( sin ( <NUM_LIT:1> ) . evalf ( ) ) <EOL> assert RR . convert ( oo ) == RR ( "<STR_LIT>" ) <EOL> assert RR . convert ( - oo ) == RR ( "<STR_LIT>" ) <EOL> raises ( CoercionFailed , lambda : RR . convert ( x ) ) <EOL> def test_ModularInteger ( ) : <EOL> F3 = FF ( <NUM_LIT:3> ) <EOL> a = F3 ( <NUM_LIT:0> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:0> <EOL> a = F3 ( <NUM_LIT:1> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:2> <EOL> a = F3 ( <NUM_LIT:3> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:0> <EOL> a = F3 ( <NUM_LIT:4> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( F3 ( <NUM_LIT:0> ) ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:0> <EOL> a = F3 ( F3 ( <NUM_LIT:1> ) ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( F3 ( <NUM_LIT:2> ) ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:2> <EOL> a = F3 ( F3 ( <NUM_LIT:3> ) ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:0> <EOL> a = F3 ( F3 ( <NUM_LIT:4> ) ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = - F3 ( <NUM_LIT:1> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:2> <EOL> a = - F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = <NUM_LIT:2> + F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) + <NUM_LIT:2> <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) + F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) + F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = <NUM_LIT:3> - F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:3> ) - <NUM_LIT:2> <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:3> ) - F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:3> ) - F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = <NUM_LIT:2> * F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) * <NUM_LIT:2> <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) * F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) * F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = <NUM_LIT:2> / F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) / <NUM_LIT:2> <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) / F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) / F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = <NUM_LIT:1> % F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:1> ) % <NUM_LIT:2> <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:1> ) % F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:1> ) % F3 ( <NUM_LIT:2> ) <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) ** <NUM_LIT:0> <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> a = F3 ( <NUM_LIT:2> ) ** <NUM_LIT:1> <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:2> <EOL> a = F3 ( <NUM_LIT:2> ) ** <NUM_LIT:2> <EOL> assert isinstance ( a , F3 . dtype ) and a == <NUM_LIT:1> <EOL> assert bool ( F3 ( <NUM_LIT:3> ) ) is False <EOL> assert bool ( F3 ( <NUM_LIT:4> ) ) is True <EOL> F5 = FF ( <NUM_LIT:5> ) <EOL> a = F5 ( <NUM_LIT:1> ) ** ( - <NUM_LIT:1> ) <EOL> assert isinstance ( a , F5 . dtype ) and a == <NUM_LIT:1> <EOL> a = F5 ( <NUM_LIT:2> ) ** ( - <NUM_LIT:1> ) <EOL> assert isinstance ( a , F5 . dtype ) and a == <NUM_LIT:3> <EOL> a = F5 ( <NUM_LIT:3> ) ** ( - <NUM_LIT:1> ) <EOL> assert isinstance ( a , F5 . dtype ) and a == <NUM_LIT:2> <EOL> a = F5 ( <NUM_LIT:4> ) ** ( - <NUM_LIT:1> ) <EOL> assert isinstance ( a , F5 . dtype ) and a == <NUM_LIT:4> <EOL> assert ( F5 ( <NUM_LIT:1> ) < F5 ( <NUM_LIT:2> ) ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) <= F5 ( <NUM_LIT:2> ) ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) > F5 ( <NUM_LIT:2> ) ) is False <EOL> assert ( F5 ( <NUM_LIT:1> ) >= F5 ( <NUM_LIT:2> ) ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) < F5 ( <NUM_LIT:2> ) ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) <= F5 ( <NUM_LIT:2> ) ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) > F5 ( <NUM_LIT:2> ) ) is True <EOL> assert ( F5 ( <NUM_LIT:3> ) >= F5 ( <NUM_LIT:2> ) ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) < F5 ( <NUM_LIT:7> ) ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) <= F5 ( <NUM_LIT:7> ) ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) > F5 ( <NUM_LIT:7> ) ) is False <EOL> assert ( F5 ( <NUM_LIT:1> ) >= F5 ( <NUM_LIT:7> ) ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) < F5 ( <NUM_LIT:7> ) ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) <= F5 ( <NUM_LIT:7> ) ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) > F5 ( <NUM_LIT:7> ) ) is True <EOL> assert ( F5 ( <NUM_LIT:3> ) >= F5 ( <NUM_LIT:7> ) ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) < <NUM_LIT:2> ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) <= <NUM_LIT:2> ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) > <NUM_LIT:2> ) is False <EOL> assert ( F5 ( <NUM_LIT:1> ) >= <NUM_LIT:2> ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) < <NUM_LIT:2> ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) <= <NUM_LIT:2> ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) > <NUM_LIT:2> ) is True <EOL> assert ( F5 ( <NUM_LIT:3> ) >= <NUM_LIT:2> ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) < <NUM_LIT:7> ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) <= <NUM_LIT:7> ) is True <EOL> assert ( F5 ( <NUM_LIT:1> ) > <NUM_LIT:7> ) is False <EOL> assert ( F5 ( <NUM_LIT:1> ) >= <NUM_LIT:7> ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) < <NUM_LIT:7> ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) <= <NUM_LIT:7> ) is False <EOL> assert ( F5 ( <NUM_LIT:3> ) > <NUM_LIT:7> ) is True <EOL> assert ( F5 ( <NUM_LIT:3> ) >= <NUM_LIT:7> ) is True <EOL> raises ( NotInvertible , lambda : F5 ( <NUM_LIT:0> ) ** ( - <NUM_LIT:1> ) ) <EOL> raises ( NotInvertible , lambda : F5 ( <NUM_LIT:5> ) ** ( - <NUM_LIT:1> ) ) <EOL> raises ( ValueError , lambda : FF ( <NUM_LIT:0> ) ) <EOL> raises ( ValueError , lambda : FF ( <NUM_LIT> ) ) <EOL> def test_QQ_int ( ) : <EOL> assert int ( QQ ( <NUM_LIT:2> ** <NUM_LIT> , <NUM_LIT:3> ** <NUM_LIT> ) ) == <NUM_LIT> <EOL> assert int ( QQ ( <NUM_LIT:2> ** <NUM_LIT:100> , <NUM_LIT:3> ) ) == <NUM_LIT> <EOL> def test_RR_double ( ) : <EOL> assert RR ( <NUM_LIT> ) > <NUM_LIT> <EOL> assert RR ( <NUM_LIT> ) > <NUM_LIT> <EOL> assert RR ( <NUM_LIT> ) > <NUM_LIT> <EOL> assert RR ( <NUM_LIT> ) > <NUM_LIT> <EOL> assert RR ( <NUM_LIT> ) > <NUM_LIT> <EOL> assert RR ( <NUM_LIT> ) > <NUM_LIT> <EOL> def test_RR_Float ( ) : <EOL> f1 = Float ( "<STR_LIT>" ) <EOL> f2 = Float ( "<STR_LIT>" ) <EOL> assert f1 . _prec == <NUM_LIT> <EOL> assert f2 . _prec == <NUM_LIT> <EOL> assert RR ( f1 ) - <NUM_LIT:1> > <NUM_LIT> <EOL> assert RR ( f2 ) - <NUM_LIT:1> < <NUM_LIT> <EOL> RR2 = RealField ( prec = f2 . _prec ) <EOL> assert RR2 ( f1 ) - <NUM_LIT:1> > <NUM_LIT> <EOL> assert RR2 ( f2 ) - <NUM_LIT:1> > <NUM_LIT> <EOL> def test_CC_double ( ) : <EOL> assert CC ( <NUM_LIT> ) . real > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . real > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . real > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . real > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . real > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . real > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . imag > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . imag > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . imag > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . imag > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . imag > <NUM_LIT> <EOL> assert CC ( <NUM_LIT> ) . imag > <NUM_LIT> </s>
