Program: 71013
Project: 71013
Buggy source:
/** 
 * Attempts to use preconditioned CGS iteration to solve M x = b for a given right-hand side <code>b</code>. Current numeric values for M are supplied by the argument <code>vals</code>. Otherwise this method behaves identically to  {@link #iterativeSolve(double[],double[],int)}.
 * @param vals supplied the current matrix values 
 * @param x returns the solution value
 * @param b supplies the right-hand side
 * @param tolExp exponent for the stopping criterion
 * @return number of iterations performed, negated if unsuccessful
 * @throws ImproperStateException if the matrix has not previously beenfactored.
 * @throws IllegalArgumentException if there are insufficient valuesspecified by <code>vals</code>, the dimensions of <code>x</code> or <code>b</code> are incompatible with the matrix size, or if <code>topExp</code> is negative.
 */
public synchronized int iterativeSolve(double[] vals,double[] x,double[] b,int tolExp){
  checkFactored();
  checkSolveArgs(x,b);
  if (vals.length < myNumVals) {
    throw new IllegalArgumentException("String_Node_Str" + vals.length + "String_Node_Str"+ myNumVals);
  }
 else   if (tolExp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  boolean rhs0=true;
  for (int i=0; i < b.length; i++) {
    if (b[i] != 0) {
      rhs0=false;
      break;
    }
  }
  int rcode=0;
  if (rhs0) {
    for (int i=0; i < x.length; i++) {
      x[i]=0;
    }
  }
 else {
    rcode=doIterativeSolve(myHandle,vals,x,b,tolExp);
  }
  if (rcode > 0) {
    myErrMsg=null;
    return rcode;
  }
 else {
    myErrMsg=getErrorMessage(rcode % 10 - 20);
    return -(rcode / 10);
  }
}

Fixed version (ground truth):
/** 
 * Attempts to use preconditioned CGS iteration to solve M x = b for a given right-hand side <code>b</code>. Current numeric values for M are supplied by the argument <code>vals</code>. Otherwise this method behaves identically to  {@link #iterativeSolve(double[],double[],int)}.
 * @param vals supplied the current matrix values 
 * @param x returns the solution value
 * @param b supplies the right-hand side
 * @param tolExp exponent for the stopping criterion
 * @return number of iterations performed, negated if unsuccessful
 * @throws ImproperStateException if the matrix has not previously beenfactored.
 * @throws IllegalArgumentException if there are insufficient valuesspecified by <code>vals</code>, the dimensions of <code>x</code> or <code>b</code> are incompatible with the matrix size, or if <code>topExp</code> is negative.
 */
public synchronized int iterativeSolve(double[] vals,double[] x,double[] b,int tolExp){
  checkFactored();
  checkSolveArgs(x,b);
  if (vals.length < myNumVals) {
    throw new IllegalArgumentException("String_Node_Str" + vals.length + "String_Node_Str"+ myNumVals);
  }
 else   if (tolExp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  boolean rhs0=true;
  for (int i=0; i < b.length; i++) {
    if (b[i] != 0) {
      rhs0=false;
      break;
    }
  }
  int rcode=0;
  if (rhs0) {
    for (int i=0; i < x.length; i++) {
      x[i]=0;
    }
  }
 else {
    rcode=doIterativeSolve(myHandle,vals,x,b,tolExp);
  }
  if (rcode > 0) {
    myErrMsg=null;
    return rcode;
  }
 else {
    myErrMsg=getErrorMessage(rcode % 10 - 20);
    return rcode;
  }
}