Program: 3429
Project: 3429
Buggy source:
/** 
 * Perform an copy matrix multiplication
 * @param other  the other matrix to perform matrix multiply with
 * @param result the result ndarray
 * @return the result of the matrix multiplication
 */
@Override public INDArray mmuli(INDArray other,INDArray result){
  ensureNotCleanedUp();
  INDArray otherArray=other;
  INDArray resultArray=result;
  if (other.shape().length > 2) {
    for (int i=0; i < other.slices(); i++) {
      result.putSlice(i,slice(i).mmul(other.slice(i)));
    }
    return result;
  }
  LinAlgExceptions.assertMultiplies(this,other);
  if (other.isScalar()) {
    return muli(otherArray.getDouble(0),resultArray);
  }
  if (isScalar()) {
    return otherArray.muli(getDouble(0),resultArray);
  }
  if (result == this || result == other) {
    INDArray temp=Nd4j.create(resultArray.shape(),ArrayUtil.calcStridesFortran(resultArray.shape()));
    if (otherArray.columns() == 1) {
      if (data.dataType() == (DataBuffer.Type.DOUBLE))       Nd4j.getBlasWrapper().gemv(1.0,this,otherArray,0.0,temp);
 else       Nd4j.getBlasWrapper().gemv(1.0f,this,otherArray,0.0f,temp);
    }
 else {
      if (data.dataType() == (DataBuffer.Type.DOUBLE))       Nd4j.getBlasWrapper().gemm(1.0,this,otherArray,0.0,temp);
 else       Nd4j.getBlasWrapper().gemm(1.0f,this,otherArray,0.0f,temp);
    }
    Nd4j.getBlasWrapper().copy(temp,resultArray);
  }
 else {
    if (otherArray.columns() == 1)     if (data.dataType() == (DataBuffer.Type.DOUBLE))     Nd4j.getBlasWrapper().gemv(1.0,this,otherArray,0.0,resultArray);
 else     Nd4j.getBlasWrapper().gemv(1.0f,this,otherArray,0.0f,resultArray);
 else {
      if (data.dataType() == (DataBuffer.Type.DOUBLE))       Nd4j.getBlasWrapper().gemm(1.0,this,otherArray,0.0,resultArray);
 else       Nd4j.getBlasWrapper().gemm(1.0f,this,otherArray,0.0f,resultArray);
    }
  }
  if (Nd4j.ENFORCE_NUMERICAL_STABILITY)   Nd4j.clearNans(resultArray);
  return resultArray;
}

Fixed version (ground truth):
/** 
 * Perform an copy matrix multiplication
 * @param other  the other matrix to perform matrix multiply with
 * @param result the result ndarray
 * @return the result of the matrix multiplication
 */
@Override public INDArray mmuli(INDArray other,INDArray result){
  ensureNotCleanedUp();
  INDArray otherArray=other;
  INDArray resultArray=result;
  if (other.shape().length > 2) {
    for (int i=0; i < other.slices(); i++) {
      result.putSlice(i,slice(i).mmul(other.slice(i)));
    }
    return result;
  }
  LinAlgExceptions.assertMultiplies(this,other);
  if (other.isScalar()) {
    return muli(otherArray.getDouble(0),resultArray);
  }
  if (isScalar()) {
    return otherArray.muli(getDouble(0),resultArray);
  }
  if (result == this || result == other) {
    INDArray temp=create(resultArray.shape(),getStrides(shape,NDArrayFactory.FORTRAN));
    if (otherArray.columns() == 1) {
      if (data.dataType() == (DataBuffer.Type.DOUBLE))       Nd4j.getBlasWrapper().gemv(1.0,this,otherArray,0.0,temp);
 else       Nd4j.getBlasWrapper().gemv(1.0f,this,otherArray,0.0f,temp);
    }
 else {
      if (data.dataType() == (DataBuffer.Type.DOUBLE))       Nd4j.getBlasWrapper().gemm(1.0,this,otherArray,0.0,temp);
 else       Nd4j.getBlasWrapper().gemm(1.0f,this,otherArray,0.0f,temp);
    }
    Nd4j.getBlasWrapper().copy(temp,resultArray);
  }
 else {
    if (otherArray.columns() == 1)     if (data.dataType() == (DataBuffer.Type.DOUBLE))     Nd4j.getBlasWrapper().gemv(1.0,this,otherArray,0.0,resultArray);
 else     Nd4j.getBlasWrapper().gemv(1.0f,this,otherArray,0.0f,resultArray);
 else {
      if (data.dataType() == (DataBuffer.Type.DOUBLE))       Nd4j.getBlasWrapper().gemm(1.0,this,otherArray,0.0,resultArray);
 else       Nd4j.getBlasWrapper().gemm(1.0f,this,otherArray,0.0f,resultArray);
    }
  }
  if (Nd4j.ENFORCE_NUMERICAL_STABILITY)   Nd4j.clearNans(resultArray);
  return resultArray;
}