code: public static double[] axpy(double a, double[] x, double[] y) {
          if (x.length != y.length) {
              throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
          }
  
          for (int i = 0; i < x.length; i++) {
              y[i] += a * x[i];
          }
  
          return y;
      }
docs: Update an array by adding a multiple of another array y = a * x + y.