<s> """<STR_LIT>""" <EOL> from __future__ import print_function , division <EOL> from sympy . polys . galoistools import gf_from_dict , gf_factor_sqf <EOL> from sympy . polys . domains import ZZ <EOL> from sympy import pi , nextprime <EOL> from sympy . core . compatibility import range <EOL> def gathen_poly ( n , p , K ) : <EOL> return gf_from_dict ( { n : K . one , <NUM_LIT:1> : K . one , <NUM_LIT:0> : K . one } , p , K ) <EOL> def shoup_poly ( n , p , K ) : <EOL> f = [ K . one ] * ( n + <NUM_LIT:1> ) <EOL> for i in range ( <NUM_LIT:1> , n + <NUM_LIT:1> ) : <EOL> f [ i ] = ( f [ i - <NUM_LIT:1> ] ** <NUM_LIT:2> + K . one ) % p <EOL> return f <EOL> def genprime ( n , K ) : <EOL> return K ( nextprime ( int ( ( <NUM_LIT:2> ** n * pi ) . evalf ( ) ) ) ) <EOL> p_10 = genprime ( <NUM_LIT:10> , ZZ ) <EOL> f_10 = gathen_poly ( <NUM_LIT:10> , p_10 , ZZ ) <EOL> p_20 = genprime ( <NUM_LIT:20> , ZZ ) <EOL> f_20 = gathen_poly ( <NUM_LIT:20> , p_20 , ZZ ) <EOL> def timeit_gathen_poly_f10_zassenhaus ( ) : <EOL> gf_factor_sqf ( f_10 , p_10 , ZZ , method = '<STR_LIT>' ) <EOL> def timeit_gathen_poly_f10_shoup ( ) : <EOL> gf_factor_sqf ( f_10 , p_10 , ZZ , method = '<STR_LIT>' ) <EOL> def timeit_gathen_poly_f20_zassenhaus ( ) : <EOL> gf_factor_sqf ( f_20 , p_20 , ZZ , method = '<STR_LIT>' ) <EOL> def timeit_gathen_poly_f20_shoup ( ) : <EOL> gf_factor_sqf ( f_20 , p_20 , ZZ , method = '<STR_LIT>' ) <EOL> P_08 = genprime ( <NUM_LIT:8> , ZZ ) <EOL> F_10 = shoup_poly ( <NUM_LIT:10> , P_08 , ZZ ) <EOL> P_18 = genprime ( <NUM_LIT> , ZZ ) <EOL> F_20 = shoup_poly ( <NUM_LIT:20> , P_18 , ZZ ) <EOL> def timeit_shoup_poly_F10_zassenhaus ( ) : <EOL> gf_factor_sqf ( F_10 , P_08 , ZZ , method = '<STR_LIT>' ) <EOL> def timeit_shoup_poly_F10_shoup ( ) : <EOL> gf_factor_sqf ( F_10 , P_08 , ZZ , method = '<STR_LIT>' ) <EOL> def timeit_shoup_poly_F20_zassenhaus ( ) : <EOL> gf_factor_sqf ( F_20 , P_18 , ZZ , method = '<STR_LIT>' ) <EOL> def timeit_shoup_poly_F20_shoup ( ) : <EOL> gf_factor_sqf ( F_20 , P_18 , ZZ , method = '<STR_LIT>' ) </s>
