Program: 76004
Project: 76004
Buggy source:
/** 
 * Invoke a specified number of iterations of this actor. Each iteration computes the math function specified by the <i>function</i> parameter on a single token. An invocation of this method therefore applies the function to <i>count</i> successive input tokens. <p> This method should be called instead of the usual prefire(), fire(), postfire() methods when this actor is used in a domain that supports vectorized actors.  This leads to more efficient execution.
 * @param count The number of iterations to perform.
 * @return COMPLETED if the actor was successfully iterated thespecified number of times. Otherwise, return NOT_READY, and do not consume any input tokens.
 * @exception IllegalActionException Should not be thrown
 */
public int iterate(int count) throws IllegalActionException {
  if (count > _resultArray.length) {
    _resultArray=new DoubleToken[count];
  }
  if (firstOperand.hasToken(0,count)) {
    Token[] inArray1=firstOperand.get(0,count);
    if (_function == REMAINDER) {
      if (secondOperand.hasToken(0,count)) {
        Token[] inArray2=secondOperand.get(0,count);
        for (int i=0; i < count; i++) {
          double input1=((DoubleToken)(inArray1[i])).doubleValue();
          double input2=((DoubleToken)(inArray2[i])).doubleValue();
          _resultArray[i]=new DoubleToken(_doFunction(input1,input2));
        }
        output.send(0,_resultArray,count);
        return COMPLETED;
      }
 else {
        return NOT_READY;
      }
    }
 else {
      for (int i=0; i < count; i++) {
        double input1=((DoubleToken)(inArray1[i])).doubleValue();
        _resultArray[i]=new DoubleToken(_doFunction(input1,0));
      }
      output.send(0,_resultArray,count);
      return COMPLETED;
    }
  }
 else {
    return NOT_READY;
  }
}

Fixed version (ground truth):
/** 
 * Invoke a specified number of iterations of this actor. Each iteration computes the math function specified by the <i>function</i> parameter on a single token. An invocation of this method therefore applies the function to <i>count</i> successive input tokens. <p> This method should be called instead of the usual prefire(), fire(), postfire() methods when this actor is used in a domain that supports vectorized actors.  This leads to more efficient execution.
 * @param count The number of iterations to perform.
 * @return COMPLETED if the actor was successfully iterated thespecified number of times. Otherwise, return NOT_READY, and do not consume any input tokens.
 * @exception IllegalActionException Not thrown in this base class
 */
public int iterate(int count) throws IllegalActionException {
  if (count > _resultArray.length) {
    _resultArray=new DoubleToken[count];
  }
  if (firstOperand.hasToken(0,count)) {
    Token[] inArray1=firstOperand.get(0,count);
    if (_function == REMAINDER) {
      if (secondOperand.hasToken(0,count)) {
        Token[] inArray2=secondOperand.get(0,count);
        for (int i=0; i < count; i++) {
          double input1=((DoubleToken)(inArray1[i])).doubleValue();
          double input2=((DoubleToken)(inArray2[i])).doubleValue();
          _resultArray[i]=new DoubleToken(_doFunction(input1,input2));
        }
        output.send(0,_resultArray,count);
        return COMPLETED;
      }
 else {
        return NOT_READY;
      }
    }
 else {
      for (int i=0; i < count; i++) {
        double input1=((DoubleToken)(inArray1[i])).doubleValue();
        _resultArray[i]=new DoubleToken(_doFunction(input1,0));
      }
      output.send(0,_resultArray,count);
      return COMPLETED;
    }
  }
 else {
    return NOT_READY;
  }
}