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