function findParams(infNorm, eps) {
    var maxSearchSize = 30;

    for (var k = 0; k < maxSearchSize; k++) {
      for (var q = 0; q <= k; q++) {
        var j = k - q;

        if (errorEstimate(infNorm, q, j) < eps) {
          return {
            q: q,
            j: j
          };
        }
      }
    }

    throw new Error('Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)');
  }
Find the best parameters for the Pade approximant given
the matrix norm and desired accuracy. Returns the first acceptable
combination in order of increasing computational load.