Runs k iterations Freivald . The value of k determines accuracy . Higher value means higher accuracy .
static bool isProduct ( int [ , ] a , int [ , ] b , int [ , ] c , int k ) { for ( int i = 0 ; i < k ; i ++ ) if ( freivald ( a , b , c ) == false ) return false ; return true ; }