<s> from math import sqrt <EOL> from sys import argv <EOL> def eval_A ( i , j ) : <EOL> ij = i + j <EOL> return <NUM_LIT:1.0> / ( ij * ( ij + <NUM_LIT:1> ) / <NUM_LIT:2> + i + <NUM_LIT:1> ) <EOL> def eval_A_times_u ( u ) : <EOL> local_eval_A = eval_A <EOL> return [ sum ( [ local_eval_A ( i , j ) * u_j <EOL> for j , u_j in enumerate ( u ) <EOL> ] <EOL> ) <EOL> for i in range ( len ( u ) ) <EOL> ] <EOL> def eval_At_times_u ( u ) : <EOL> local_eval_A = eval_A <EOL> return [ sum ( [ local_eval_A ( j , i ) * u_j <EOL> for j , u_j in enumerate ( u ) <EOL> ] <EOL> ) <EOL> for i in range ( len ( u ) ) <EOL> ] <EOL> def eval_AtA_times_u ( u ) : <EOL> return eval_At_times_u ( eval_A_times_u ( u ) ) <EOL> def main ( ) : <EOL> n = <NUM_LIT:1000> <EOL> u = [ <NUM_LIT:1> ] * n <EOL> local_eval_AtA_times_u = eval_AtA_times_u <EOL> for dummy in range ( <NUM_LIT:10> ) : <EOL> v = local_eval_AtA_times_u ( u ) <EOL> u = local_eval_AtA_times_u ( v ) <EOL> vBv = vv = <NUM_LIT:0> <EOL> for ue , ve in zip ( u , v ) : <EOL> vBv += ue * ve <EOL> vv += ve * ve <EOL> print ( "<STR_LIT>" % ( sqrt ( vBv / vv ) ) ) <EOL> main ( ) </s>
