code: private static double ax(Matrix A, double[] x, double[] y, double p) {
          A.ax(x, y);
  
          if (p != 0.0) {
              for (int i = 0; i < y.length; i++) {
                  y[i] -= p * x[i];
              }
          }
  
          double lambda = y[0];
          for (int i = 1; i < y.length; i++) {
              if (Math.abs(y[i]) > Math.abs(lambda)) {
                  lambda = y[i];
              }
          }
  
          for (int i = 0; i < y.length; i++) {
              x[i] = y[i] / lambda;
          }
  
          return lambda;
      }
docs: Calculate and normalize y = (A - pI) x.
  Returns the largest element of y in magnitude.