code: public static boolean checkMmul(INDArray first, INDArray second, double maxRelativeDifference,
                      double minAbsDifference) {
          if (first.size(1) != second.size(0))
              throw new IllegalArgumentException("first.columns != second.rows");
          RealMatrix rmFirst = convertToApacheMatrix(first);
          RealMatrix rmSecond = convertToApacheMatrix(second);
  
          INDArray result = first.mmul(second);
          RealMatrix rmResult = rmFirst.multiply(rmSecond);
  
          if (!checkShape(rmResult, result))
              return false;
          boolean ok = checkEntries(rmResult, result, maxRelativeDifference, minAbsDifference);
          if (!ok) {
              INDArray onCopies = Shape.toOffsetZeroCopy(first).mmul(Shape.toOffsetZeroCopy(second));
              printFailureDetails(first, second, rmResult, result, onCopies, "mmul");
          }
          return ok;
      }
docs: Check first.mmul(second) using Apache commons math mmul. Float/double matrices only.<br>
  Returns true if OK, false otherwise.<br>
  Checks each element according to relative error (|a-b|/(|a|+|b|); however absolute error |a-b| must
  also exceed minAbsDifference for it to be considered a failure. This is necessary to avoid instability
  near 0: i.e., Nd4j mmul might return element of 0.0 (due to underflow on float) while Apache commons math
  mmul might be say 1e-30 or something (using doubles).
  Throws exception if matrices can't be multiplied
  Checks each element of the result. If
  @param first First matrix
  @param second Second matrix
  @param maxRelativeDifference Maximum relative error
  @param minAbsDifference Minimum absolute difference for failure
  @return true if OK, false if result incorrect