nus-yam/ex-repair huggingface dataset:
Program: 57121
Project: 57121
Buggy source:
/** 
 * This is a utility function used by   {@link #inverseCumulativeProbability(double)}. It assumes   {@code 0 < p < 1} andthat the inverse cumulative probability lies in the bracket  {@code (lower, upper]}. The implementation does simple bisection to find the smallest   {@code p}-quantile <code>inf{x in Z | P(X<=x) >= p}</code>.
 * @param p the cumulative probability
 * @param lower a value satisfying {@code cumulativeProbability(lower) < p}
 * @param upper a value satisfying {@code p <= cumulativeProbability(upper)}
 * @return the smallest {@code p}-quantile of this distribution
 */
protected int solveInverseCumulativeProbability(final double p,int lower,int upper){
  while (lower + 1 < upper) {
    int xm=(lower + upper) / 2;
    if (xm < lower || xm > upper) {
      xm=lower + (upper - lower) / 2;
    }
    double pm=checkedCumulativeProbability(xm);
    if (pm >= p) {
      upper=xm;
    }
 else {
      lower=xm;
    }
  }
  return upper;
}

Fixed version (ground truth):
/** 
 * This is a utility function used by   {@link #inverseCumulativeProbability(double)}. It assumes   {@code 0 < p < 1} andthat the inverse cumulative probability lies in the bracket  {@code (lower, upper]}. The implementation does simple bisection to find the smallest   {@code p}-quantile   {@code} infx in Z | P(X<=x) >= p}}.
 * @param p the cumulative probability
 * @param lower a value satisfying {@code cumulativeProbability(lower) < p}
 * @param upper a value satisfying {@code p <= cumulativeProbability(upper)}
 * @return the smallest {@code p}-quantile of this distribution
 */
protected int solveInverseCumulativeProbability(final double p,int lower,int upper){
  while (lower + 1 < upper) {
    int xm=(lower + upper) / 2;
    if (xm < lower || xm > upper) {
      xm=lower + (upper - lower) / 2;
    }
    double pm=checkedCumulativeProbability(xm);
    if (pm >= p) {
      upper=xm;
    }
 else {
      lower=xm;
    }
  }
  return upper;
}
Program: 57122
Project: 57122
Buggy source:
/** 
 * {@inheritDoc}<p>Algorithm description:<ol> <li>Find the bin B that x belongs to.</li> <li>Compute P(B) = the mass of B and P(B-) = the combined mass of the bins below B.</li> <li>Compute K(B) = the probability mass of B with respect to the within-bin kernel and K(B-) = the kernel distribution evaluated at the lower endpoint of B</li> <li>Return P(B-) + P(B) * [K(x) - K(B-)] / K(B) where K(x) is the within-bin kernel distribution function evaluated at x.</li></ol> If K is a constant distribution, we return P(B-) + P(B) (counting the full mass of B).</p>
 * @since 3.1
 */
@Override public double cumulativeProbability(double x){
  if (x < min) {
    return 0d;
  }
 else   if (x >= max) {
    return 1d;
  }
  final int binIndex=findBin(x);
  final double pBminus=pBminus(binIndex);
  final double pB=pB(binIndex);
  final RealDistribution kernel=k(x);
  if (kernel instanceof ConstantRealDistribution) {
    if (x < kernel.getNumericalMean()) {
      return pBminus;
    }
 else {
      return pBminus + pB;
    }
  }
  final double[] binBounds=getUpperBounds();
  final double kB=kB(binIndex);
  final double lower=binIndex == 0 ? min : binBounds[binIndex - 1];
  final double withinBinCum=(kernel.cumulativeProbability(x) - kernel.cumulativeProbability(lower)) / kB;
  return pBminus + pB * withinBinCum;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p>Algorithm description:<ol> <li>Find the bin B that x belongs to.</li> <li>Compute P(B) = the mass of B and P(B-) = the combined mass of the bins below B.</li> <li>Compute K(B) = the probability mass of B with respect to the within-bin kernel and K(B-) = the kernel distribution evaluated at the lower endpoint of B</li> <li>Return P(B-) + P(B) * [K(x) - K(B-)] / K(B) where K(x) is the within-bin kernel distribution function evaluated at x.</li></ol> If K is a constant distribution, we return P(B-) + P(B) (counting the full mass of B).
 * @since 3.1
 */
@Override public double cumulativeProbability(double x){
  if (x < min) {
    return 0d;
  }
 else   if (x >= max) {
    return 1d;
  }
  final int binIndex=findBin(x);
  final double pBminus=pBminus(binIndex);
  final double pB=pB(binIndex);
  final RealDistribution kernel=k(x);
  if (kernel instanceof ConstantRealDistribution) {
    if (x < kernel.getNumericalMean()) {
      return pBminus;
    }
 else {
      return pBminus + pB;
    }
  }
  final double[] binBounds=getUpperBounds();
  final double kB=kB(binIndex);
  final double lower=binIndex == 0 ? min : binBounds[binIndex - 1];
  final double withinBinCum=(kernel.cumulativeProbability(x) - kernel.cumulativeProbability(lower)) / kB;
  return pBminus + pB * withinBinCum;
}
Program: 57123
Project: 57123
Buggy source:
/** 
 * <p>Return the probability mass function as a list of <value, probability> pairs.</p> <p>Note that if duplicate and / or null values were provided to the constructor when creating this EnumeratedDistribution, the returned list will contain these values.  If duplicates values exist, what is returned will not represent a pmf (i.e., it is up to the caller to consolidate duplicate mass points).</p>
 * @return the probability mass function.
 */
public List<Pair<T,Double>> getPmf(){
  final List<Pair<T,Double>> samples=new ArrayList<>(probabilities.length);
  for (int i=0; i < probabilities.length; i++) {
    samples.add(new Pair<>(singletons.get(i),probabilities[i]));
  }
  return samples;
}

Fixed version (ground truth):
/** 
 * <p>Return the probability mass function as a list of &lt;value, probability&gt; pairs.</p> <p>Note that if duplicate and / or null values were provided to the constructor when creating this EnumeratedDistribution, the returned list will contain these values.  If duplicates values exist, what is returned will not represent a pmf (i.e., it is up to the caller to consolidate duplicate mass points).</p>
 * @return the probability mass function.
 */
public List<Pair<T,Double>> getPmf(){
  final List<Pair<T,Double>> samples=new ArrayList<>(probabilities.length);
  for (int i=0; i < probabilities.length; i++) {
    samples.add(new Pair<>(singletons.get(i),probabilities[i]));
  }
  return samples;
}
Program: 57124
Project: 57124
Buggy source:
/** 
 * {@inheritDoc}The implementation of this method is based on: <ul> <li> <a href="http://mathworld.wolfram.com/Chi-SquaredDistribution.html"> Chi-Squared Distribution</a>, equation (9). </li> <li>Casella, G., & Berger, R. (1990). <i>Statistical Inference</i>. Belmont, CA: Duxbury Press. </li> </ul>
 */
@Override public double cumulativeProbability(double x){
  double ret;
  if (x <= 0) {
    ret=0;
  }
 else {
    ret=Gamma.regularizedGammaP(shape,x / scale);
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}The implementation of this method is based on: <ul> <li> <a href="http://mathworld.wolfram.com/Chi-SquaredDistribution.html"> Chi-Squared Distribution</a>, equation (9). </li> <li>Casella, G., &amp; Berger, R. (1990). <i>Statistical Inference</i>. Belmont, CA: Duxbury Press. </li> </ul>
 */
@Override public double cumulativeProbability(double x){
  double ret;
  if (x <= 0) {
    ret=0;
  }
 else {
    ret=Gamma.regularizedGammaP(shape,x / scale);
  }
  return ret;
}
Program: 57125
Project: 57125
Buggy source:
/** 
 * Computes the quantile function of this distribution. For a random variable   {@code X} distributed according to this distribution,the returned value is <ul> <li><code>inf{x in Z | P(X<=x) >= p}</code> for  {@code 0 < p <= 1},</li> <li><code>inf{x in Z | P(X<=x) > 0}</code> for   {@code p = 0}.</li> </ul> If the result exceeds the range of the data type   {@code int}, then   {@code Integer.MIN_VALUE} or {@code Integer.MAX_VALUE} is returned.
 * @param p the cumulative probability
 * @return the smallest {@code p}-quantile of this distribution (largest 0-quantile for   {@code p = 0})
 * @throws OutOfRangeException if {@code p < 0} or {@code p > 1}
 */
int inverseCumulativeProbability(double p) throws OutOfRangeException ;

Fixed version (ground truth):
/** 
 * Computes the quantile function of this distribution. For a random variable   {@code X} distributed according to this distribution,the returned value is <ul> <li> {@code} infx in Z | P(X<=x) >= p}} for  {@code 0 < p <= 1},</li> <li>  {@code} infx in Z | P(X<=x) > 0}} for  {@code p = 0}.</li> </ul> If the result exceeds the range of the data type   {@code int}, then   {@code Integer.MIN_VALUE} or {@code Integer.MAX_VALUE} is returned.
 * @param p the cumulative probability
 * @return the smallest {@code p}-quantile of this distribution (largest 0-quantile for   {@code p = 0})
 * @throws OutOfRangeException if {@code p < 0} or {@code p > 1}
 */
int inverseCumulativeProbability(double p) throws OutOfRangeException ;
Program: 57126
Project: 57126
Buggy source:
/** 
 * Access the lower bound of the support. This method must return the same value as   {@code inverseCumulativeProbability(0)}. In other words, this method must return <p><code>inf {x in Z | P(X <= x) > 0}</code>.</p>
 * @return lower bound of the support ({@code Integer.MIN_VALUE}for negative infinity)
 */
int getSupportLowerBound();

Fixed version (ground truth):
/** 
 * Access the lower bound of the support. This method must return the same value as   {@code inverseCumulativeProbability(0)}. In other words, this method must return <p>  {@code} inf x in Z | P(X <= x) > 0}}.</p>
 * @return lower bound of the support ({@code Integer.MIN_VALUE}for negative infinity)
 */
int getSupportLowerBound();
Program: 57127
Project: 57127
Buggy source:
/** 
 * Access the upper bound of the support. This method must return the same value as   {@code inverseCumulativeProbability(1)}. In other words, this method must return <p><code>inf {x in R | P(X <= x) = 1}</code>.</p>
 * @return upper bound of the support ({@code Integer.MAX_VALUE}for positive infinity)
 */
int getSupportUpperBound();

Fixed version (ground truth):
/** 
 * Access the upper bound of the support. This method must return the same value as   {@code inverseCumulativeProbability(1)}. In other words, this method must return <p>  {@code} inf x in R | P(X <= x) = 1}}.</p>
 * @return upper bound of the support ({@code Integer.MAX_VALUE}for positive infinity)
 */
int getSupportUpperBound();
Program: 57128
Project: 57128
Buggy source:
/** 
 * {@inheritDoc}<p> From Wikipedia: The probability density function of the L&eacute;vy distribution over the domain is </p> <pre> f(x; &mu;, c) = &radic;(c / 2&pi;) * e<sup>-c / 2 (x - &mu;)</sup> / (x - &mu;)<sup>3/2</sup> </pre> <p> For this distribution,   {@code X}, this method returns   {@code P(X < x)}. If   {@code x} is less than location parameter &mu;, {@code Double.NaN} isreturned, as in these cases the distribution is not defined. </p>
 */
@Override public double density(final double x){
  if (x < mu) {
    return Double.NaN;
  }
  final double delta=x - mu;
  final double f=halfC / delta;
  return FastMath.sqrt(f / FastMath.PI) * FastMath.exp(-f) / delta;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}<p> From Wikipedia: The probability density function of the L&eacute;vy distribution over the domain is </p> <div style="white-space: pre"><code> f(x; &mu;, c) = &radic;(c / 2&pi;) * e<sup>-c / 2 (x - &mu;)</sup> / (x - &mu;)<sup>3/2</sup> </code></div> <p> For this distribution,   {@code X}, this method returns   {@code P(X < x)}. If   {@code x} is less than location parameter &mu;, {@code Double.NaN} isreturned, as in these cases the distribution is not defined. </p>
 */
@Override public double density(final double x){
  if (x < mu) {
    return Double.NaN;
  }
  final double delta=x - mu;
  final double f=halfC / delta;
  return FastMath.sqrt(f / FastMath.PI) * FastMath.exp(-f) / delta;
}
Program: 57129
Project: 57129
Buggy source:
/** 
 * Computes the quantile function of this distribution. For a random variable   {@code X} distributed according to this distribution, thereturned value is <ul> <li><code>inf{x in R | P(X<=x) >= p}</code> for  {@code 0 < p <= 1},</li> <li><code>inf{x in R | P(X<=x) > 0}</code> for   {@code p = 0}.</li> </ul>
 * @param p the cumulative probability
 * @return the smallest {@code p}-quantile of this distribution (largest 0-quantile for   {@code p = 0})
 * @throws OutOfRangeException if {@code p < 0} or {@code p > 1}
 */
double inverseCumulativeProbability(double p) throws OutOfRangeException ;

Fixed version (ground truth):
/** 
 * Computes the quantile function of this distribution. For a random variable   {@code X} distributed according to this distribution, thereturned value is <ul> <li> {@code} infx in R | P(X<=x) >= p}} for  {@code 0 < p <= 1},</li> <li>  {@code} infx in R | P(X<=x) > 0}} for  {@code p = 0}.</li> </ul>
 * @param p the cumulative probability
 * @return the smallest {@code p}-quantile of this distribution (largest 0-quantile for   {@code p = 0})
 * @throws OutOfRangeException if {@code p < 0} or {@code p > 1}
 */
double inverseCumulativeProbability(double p) throws OutOfRangeException ;
Program: 57130
Project: 57130
Buggy source:
/** 
 * Access the lower bound of the support. This method must return the same value as   {@code inverseCumulativeProbability(0)}. In other words, this method must return <p><code>inf {x in R | P(X <= x) > 0}</code>.</p>
 * @return lower bound of the support (might be{@code Double.NEGATIVE_INFINITY})
 */
double getSupportLowerBound();

Fixed version (ground truth):
/** 
 * Access the lower bound of the support. This method must return the same value as   {@code inverseCumulativeProbability(0)}. In other words, this method must return <p>  {@code} inf x in R | P(X <= x) > 0}}.</p>
 * @return lower bound of the support (might be{@code Double.NEGATIVE_INFINITY})
 */
double getSupportLowerBound();
Program: 57131
Project: 57131
Buggy source:
/** 
 * Access the upper bound of the support. This method must return the same value as   {@code inverseCumulativeProbability(1)}. In other words, this method must return <p><code>inf {x in R | P(X <= x) = 1}</code>.</p>
 * @return upper bound of the support (might be{@code Double.POSITIVE_INFINITY})
 */
double getSupportUpperBound();

Fixed version (ground truth):
/** 
 * Access the upper bound of the support. This method must return the same value as   {@code inverseCumulativeProbability(1)}. In other words, this method must return <p>  {@code} inf x in R | P(X <= x) = 1}}.</p>
 * @return upper bound of the support (might be{@code Double.POSITIVE_INFINITY})
 */
double getSupportUpperBound();
Program: 57132
Project: 57132
Buggy source:
/** 
 * <p>Returns the weighted product of the entries in the input array.</p> <p>Throws <code>MathIllegalArgumentException</code> if any of the following are true: <ul><li>the values array is null</li> <li>the weights array is null</li> <li>the weights array does not have the same length as the values array</li> <li>the weights array contains one or more infinite values</li> <li>the weights array contains one or more NaN values</li> <li>the weights array contains negative values</li> </ul> <p>Uses the formula, <pre> weighted product = &prod;values[i]<sup>weights[i]</sup> </pre> that is, the weights are applied as exponents when computing the weighted product.</p>
 * @param values the input array
 * @param weights the weights array
 * @return the product of the values or Double.NaN if length = 0
 * @throws MathIllegalArgumentException if the parameters are not valid
 * @since 2.1
 */
@Override public double evaluate(final double[] values,final double[] weights) throws MathIllegalArgumentException {
  return evaluate(values,weights,0,values.length);
}

Fixed version (ground truth):
/** 
 * <p>Returns the weighted product of the entries in the input array.</p> <p>Throws <code>MathIllegalArgumentException</code> if any of the following are true: <ul><li>the values array is null</li> <li>the weights array is null</li> <li>the weights array does not have the same length as the values array</li> <li>the weights array contains one or more infinite values</li> <li>the weights array contains one or more NaN values</li> <li>the weights array contains negative values</li> </ul> <p>Uses the formula, <div style="white-space: pre"><code> weighted product = &prod;values[i]<sup>weights[i]</sup> </code></div> that is, the weights are applied as exponents when computing the weighted product.
 * @param values the input array
 * @param weights the weights array
 * @return the product of the values or Double.NaN if length = 0
 * @throws MathIllegalArgumentException if the parameters are not valid
 * @since 2.1
 */
@Override public double evaluate(final double[] values,final double[] weights) throws MathIllegalArgumentException {
  return evaluate(values,weights,0,values.length);
}
Program: 57133
Project: 57133
Buggy source:
/** 
 * Get the abscissa of the vector.
 * @return abscissa of the vector
 * @see #Cartesian1D(double)
 */
public abstract double getX();

Fixed version (ground truth):
/** 
 * Get the abscissa of the vector.
 * @return abscissa of the vector
 * @see Cartesian1D#Cartesian1D(double)
 */
public abstract double getX();
Program: 57134
Project: 57134
Buggy source:
/** 
 * Get a vector orthogonal to the instance. <p>There are an infinite number of normalized vectors orthogonal to the instance. This method picks up one of them almost arbitrarily. It is useful when one needs to compute a reference frame with one of the axes in a predefined direction. The following example shows how to build a frame having the k axis aligned with the known vector u : <pre><code> Cartesian3D k = u.normalize(); Cartesian3D i = k.orthogonal(); Cartesian3D j = Cartesian3D.crossProduct(k, i); </code></pre></p>
 * @return a new normalized vector orthogonal to the instance
 * @exception MathArithmeticException if the norm of the instance is null
 */
public Cartesian3D orthogonal() throws MathArithmeticException {
  double threshold=0.6 * getNorm();
  if (threshold == 0) {
    throw new MathArithmeticException(LocalizedFormats.ZERO_NORM);
  }
  if (FastMath.abs(x) <= threshold) {
    double inverse=1 / FastMath.sqrt(y * y + z * z);
    return new Cartesian3D(0,inverse * z,-inverse * y);
  }
 else   if (FastMath.abs(y) <= threshold) {
    double inverse=1 / FastMath.sqrt(x * x + z * z);
    return new Cartesian3D(-inverse * z,0,inverse * x);
  }
  double inverse=1 / FastMath.sqrt(x * x + y * y);
  return new Cartesian3D(inverse * y,-inverse * x,0);
}

Fixed version (ground truth):
/** 
 * Get a vector orthogonal to the instance. <p>There are an infinite number of normalized vectors orthogonal to the instance. This method picks up one of them almost arbitrarily. It is useful when one needs to compute a reference frame with one of the axes in a predefined direction. The following example shows how to build a frame having the k axis aligned with the known vector u : <pre><code> Cartesian3D k = u.normalize(); Cartesian3D i = k.orthogonal(); Cartesian3D j = Cartesian3D.crossProduct(k, i); </code></pre>
 * @return a new normalized vector orthogonal to the instance
 * @exception MathArithmeticException if the norm of the instance is null
 */
public Cartesian3D orthogonal() throws MathArithmeticException {
  double threshold=0.6 * getNorm();
  if (threshold == 0) {
    throw new MathArithmeticException(LocalizedFormats.ZERO_NORM);
  }
  if (FastMath.abs(x) <= threshold) {
    double inverse=1 / FastMath.sqrt(y * y + z * z);
    return new Cartesian3D(0,inverse * z,-inverse * y);
  }
 else   if (FastMath.abs(y) <= threshold) {
    double inverse=1 / FastMath.sqrt(x * x + z * z);
    return new Cartesian3D(-inverse * z,0,inverse * x);
  }
  double inverse=1 / FastMath.sqrt(x * x + y * y);
  return new Cartesian3D(inverse * y,-inverse * x,0);
}
Program: 57135
Project: 57135
Buggy source:
/** 
 * Get the abscissa of the vector.
 * @return abscissa of the vector
 * @see #Cartesian3D(double,double,double)
 */
public abstract double getX();

Fixed version (ground truth):
/** 
 * Get the abscissa of the vector.
 * @return abscissa of the vector
 * @see Cartesian3D#Cartesian3D(double,double,double)
 */
public abstract double getX();
Program: 57136
Project: 57136
Buggy source:
/** 
 * Get the ordinate of the vector.
 * @return ordinate of the vector
 * @see #Cartesian3D(double,double,double)
 */
public abstract double getY();

Fixed version (ground truth):
/** 
 * Get the ordinate of the vector.
 * @return ordinate of the vector
 * @see Cartesian3D#Cartesian3D(double,double,double)
 */
public abstract double getY();
Program: 57137
Project: 57137
Buggy source:
/** 
 * Get the height of the vector.
 * @return height of the vector
 * @see #Cartesian3D(double,double,double)
 */
public abstract double getZ();

Fixed version (ground truth):
/** 
 * Get the height of the vector.
 * @return height of the vector
 * @see Cartesian3D#Cartesian3D(double,double,double)
 */
public abstract double getZ();
Program: 57138
Project: 57138
Buggy source:
/** 
 * Get the abscissa of the vector.
 * @return abscissa of the vector
 * @see #Cartesian2D(double,double)
 */
public abstract double getX();

Fixed version (ground truth):
/** 
 * Get the abscissa of the vector.
 * @return abscissa of the vector
 * @see Cartesian2D#Cartesian2D(double,double)
 */
public abstract double getX();
Program: 57139
Project: 57139
Buggy source:
/** 
 * Get the ordinate of the vector.
 * @return ordinate of the vector
 * @see #Cartesian2D(double,double)
 */
public abstract double getY();

Fixed version (ground truth):
/** 
 * Get the ordinate of the vector.
 * @return ordinate of the vector
 * @see Cartesian2D#Cartesian2D(double,double)
 */
public abstract double getY();
Program: 57140
Project: 57140
Buggy source:
/** 
 * Adds random jitter to   {@code data} using deviates sampled from {@code dist}. <p> Note that jitter is applied in-place - i.e., the array values are overwritten with the result of applying jitter.</p>
 * @param data input/output data array - entries overwritten by the method
 * @param sampler probability distribution to sample for jitter values
 * @throws NullPointerException if either of the parameters is null
 */
private static void jitter(double[] data,UniformRandomProvider rng,int ulp){
  final int range=ulp * 2;
  for (int i=0; i < data.length; i++) {
    final int rand=rng.nextInt(range) - ulp;
    data[i]+=rand * Math.ulp(data[i]);
  }
}

Fixed version (ground truth):
/** 
 * Adds random jitter to   {@code data} using deviates sampled from {@code dist}. <p> Note that jitter is applied in-place - i.e., the array values are overwritten with the result of applying jitter.</p>
 * @param data input/output data array - entries overwritten by the method
 * @param rng probability distribution to sample for jitter values
 * @param ulp ulp used when generating random numbers
 * @throws NullPointerException if either of the parameters is null
 */
private static void jitter(double[] data,UniformRandomProvider rng,int ulp){
  final int range=ulp * 2;
  for (int i=0; i < data.length; i++) {
    final int rand=rng.nextInt(range) - ulp;
    data[i]+=rand * Math.ulp(data[i]);
  }
}
Program: 57141
Project: 57141
Buggy source:
@Test public void testFormatObjectStringBufferFieldPositionWitNumber(){
  ComplexFormat cf=ComplexFormat.getInstance();
  String source="String_Node_Str" + getDecimalCharacter() + "String_Node_Str";
  Number expected=new Double(1.23);
  String formatted=cf.format(expected,new StringBuffer(),new FieldPosition(0)).toString();
  Assert.assertEquals(source,formatted);
}

Fixed version (ground truth):
@Test public void testFormatObjectStringBufferFieldPositionWitNumber(){
  ComplexFormat cf=ComplexFormat.getInstance(getLocale());
  String source="String_Node_Str" + getDecimalCharacter() + "String_Node_Str";
  Number expected=new Double(1.23);
  String formatted=cf.format(expected,new StringBuffer(),new FieldPosition(0)).toString();
  Assert.assertEquals(source,formatted);
}
Program: 57142
Project: 57142
Buggy source:
@Test public void testFormatObjectStringBufferFieldPositionWithComplex(){
  ComplexFormat cf=ComplexFormat.getInstance();
  String source="String_Node_Str" + getDecimalCharacter() + "String_Node_Str"+ getDecimalCharacter()+ "String_Node_Str";
  Object expected=new Complex(1.23,1.43);
  String formatted=cf.format(expected,new StringBuffer(),new FieldPosition(0)).toString();
  Assert.assertEquals(source,formatted);
}

Fixed version (ground truth):
@Test public void testFormatObjectStringBufferFieldPositionWithComplex(){
  ComplexFormat cf=ComplexFormat.getInstance(getLocale());
  String source="String_Node_Str" + getDecimalCharacter() + "String_Node_Str"+ getDecimalCharacter()+ "String_Node_Str";
  Object expected=new Complex(1.23,1.43);
  String formatted=cf.format(expected,new StringBuffer(),new FieldPosition(0)).toString();
  Assert.assertEquals(source,formatted);
}
Program: 57144
Project: 57144
Buggy source:
@Test public void testBigStep() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestBigStep(Decimal64Field.getInstance(),0.00002,0.001,1.0e-12,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testBigStep() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestBigStep(Decimal64Field.getInstance(),2.7e-5,1.7e-3,1.0e-12,"String_Node_Str");
}
Program: 57145
Project: 57145
Buggy source:
@Test public void testSingleStep(){
  doTestSingleStep(Decimal64Field.getInstance(),1.0e-11);
}

Fixed version (ground truth):
@Test public void testSingleStep(){
  doTestSingleStep(Decimal64Field.getInstance(),6.0e-12);
}
Program: 57146
Project: 57146
Buggy source:
@Test public void testStepSize() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestStepSize(Decimal64Field.getInstance(),1.0e-12);
}

Fixed version (ground truth):
@Test public void testStepSize() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestStepSize(Decimal64Field.getInstance(),1.0e-22);
}
Program: 57147
Project: 57147
Buggy source:
@Test public void testSmallStep() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestSmallStep(Decimal64Field.getInstance(),9.0e-17,4.0e-15,1.0e-12,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSmallStep() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestSmallStep(Decimal64Field.getInstance(),8.7e-17,3.6e-15,1.0e-12,"String_Node_Str");
}
Program: 57148
Project: 57148
Buggy source:
@Test public void testDerivativesConsistency(){
  doTestDerivativesConsistency(Decimal64Field.getInstance(),1.0e-10);
}

Fixed version (ground truth):
@Test public void testDerivativesConsistency(){
  doTestDerivativesConsistency(Decimal64Field.getInstance(),1.0e-20);
}
Program: 57149
Project: 57149
Buggy source:
@Test public void testKepler() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestKepler(Decimal64Field.getInstance(),2.2e-7,1.0e-8);
}

Fixed version (ground truth):
@Test public void testKepler() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestKepler(Decimal64Field.getInstance(),2.18e-7,4.0e-10);
}
Program: 57150
Project: 57150
Buggy source:
@Test public void testBackward() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestBackward(Decimal64Field.getInstance(),3.0e-13,5.0e-13,1.0e-12,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testBackward() throws DimensionMismatchException, NumberIsTooSmallException, MaxCountExceededException, NoBracketingException {
  doTestBackward(Decimal64Field.getInstance(),2.4e-13,4.3e-13,1.0e-12,"String_Node_Str");
}
Program: 57151
Project: 57151
Buggy source:
@Test public void testUnstableDerivative(){
  doTestUnstableDerivative(Decimal64Field.getInstance(),1.0e-12);
}

Fixed version (ground truth):
@Test public void testUnstableDerivative(){
  doTestUnstableDerivative(Decimal64Field.getInstance(),4.0e-15);
}
Program: 57152
Project: 57152
Buggy source:
@Test public void interpolationInside(){
  doInterpolationInside(Decimal64Field.getInstance(),3.3e-14,7.9e-13);
}

Fixed version (ground truth):
@Test public void interpolationInside(){
  doInterpolationInside(Decimal64Field.getInstance(),1.1e-7,9.6e-9);
}
Program: 57154
Project: 57154
Buggy source:
/** 
 * Returns the skewness of the available values. Skewness is a measure of the asymmetry of a given distribution.
 * @return The skewness, Double.NaN if no values have been addedor 0.0 for a value set &lt;=2.
 */
public double getSkewness(){
  return apply(skewnessImpl);
}

Fixed version (ground truth):
/** 
 * Returns the skewness of the available values. Skewness is a measure of the asymmetry of a given distribution.
 * @return The skewness, Double.NaN if less than 3 values have been added.
 */
public double getSkewness(){
  return apply(skewnessImpl);
}
Program: 57155
Project: 57155
Buggy source:
/** 
 * Returns the <a href="http://www.xycoon.com/geometric_mean.htm"> geometric mean </a> of the available values
 * @return The geometricMean, Double.NaN if no values have been added,or if the product of the available values is less than or equal to 0.
 */
public double getGeometricMean(){
  return apply(geometricMeanImpl);
}

Fixed version (ground truth):
/** 
 * Returns the <a href="http://www.xycoon.com/geometric_mean.htm"> geometric mean </a> of the available values. <p> See   {@link GeometricMean} for details on the computing algorithm.</p>
 * @return The geometricMean, Double.NaN if no values have been added,or if any negative values have been added.
 */
public double getGeometricMean(){
  return apply(geometricMeanImpl);
}
Program: 57156
Project: 57156
Buggy source:
/** 
 * Returns the Kurtosis of the available values. Kurtosis is a measure of the "peakedness" of a distribution
 * @return The kurtosis, Double.NaN if no values have been added, or 0.0for a value set &lt;=3.
 */
public double getKurtosis(){
  return apply(kurtosisImpl);
}

Fixed version (ground truth):
/** 
 * Returns the Kurtosis of the available values. Kurtosis is a measure of the "peakedness" of a distribution.
 * @return The kurtosis, Double.NaN if less than 4 values have been added.
 */
public double getKurtosis(){
  return apply(kurtosisImpl);
}
Program: 57157
Project: 57157
Buggy source:
/** 
 * Sort the observations.
 * @param unsorted Input observations.
 * @return the input observations, sorted.
 */
private List<WeightedObservedPoint> sortObservations(Collection<WeightedObservedPoint> unsorted){
  final List<WeightedObservedPoint> observations=new ArrayList<WeightedObservedPoint>(unsorted);
  final Comparator<WeightedObservedPoint> cmp=new Comparator<WeightedObservedPoint>(){
    @Override public int compare(    WeightedObservedPoint p1,    WeightedObservedPoint p2){
      if (p1 == null && p2 == null) {
        return 0;
      }
      if (p1 == null) {
        return -1;
      }
      if (p2 == null) {
        return 1;
      }
      if (p1.getX() < p2.getX()) {
        return -1;
      }
      if (p1.getX() > p2.getX()) {
        return 1;
      }
      if (p1.getY() < p2.getY()) {
        return -1;
      }
      if (p1.getY() > p2.getY()) {
        return 1;
      }
      if (p1.getWeight() < p2.getWeight()) {
        return -1;
      }
      if (p1.getWeight() > p2.getWeight()) {
        return 1;
      }
      return 0;
    }
  }
;
  Collections.sort(observations,cmp);
  return observations;
}

Fixed version (ground truth):
/** 
 * Sort the observations.
 * @param unsorted Input observations.
 * @return the input observations, sorted.
 */
private List<WeightedObservedPoint> sortObservations(Collection<WeightedObservedPoint> unsorted){
  final List<WeightedObservedPoint> observations=new ArrayList<WeightedObservedPoint>(unsorted);
  final Comparator<WeightedObservedPoint> cmp=new Comparator<WeightedObservedPoint>(){
    @Override public int compare(    WeightedObservedPoint p1,    WeightedObservedPoint p2){
      if (p1 == null && p2 == null) {
        return 0;
      }
      if (p1 == null) {
        return -1;
      }
      if (p2 == null) {
        return 1;
      }
      int comp=Double.compare(p1.getX(),p2.getX());
      if (comp != 0) {
        return comp;
      }
      comp=Double.compare(p1.getY(),p2.getY());
      if (comp != 0) {
        return comp;
      }
      comp=Double.compare(p1.getWeight(),p2.getWeight());
      if (comp != 0) {
        return comp;
      }
      return 0;
    }
  }
;
  Collections.sort(observations,cmp);
  return observations;
}
Program: 57158
Project: 57158
Buggy source:
@Override public int compare(WeightedObservedPoint p1,WeightedObservedPoint p2){
  if (p1 == null && p2 == null) {
    return 0;
  }
  if (p1 == null) {
    return -1;
  }
  if (p2 == null) {
    return 1;
  }
  if (p1.getX() < p2.getX()) {
    return -1;
  }
  if (p1.getX() > p2.getX()) {
    return 1;
  }
  if (p1.getY() < p2.getY()) {
    return -1;
  }
  if (p1.getY() > p2.getY()) {
    return 1;
  }
  if (p1.getWeight() < p2.getWeight()) {
    return -1;
  }
  if (p1.getWeight() > p2.getWeight()) {
    return 1;
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(WeightedObservedPoint p1,WeightedObservedPoint p2){
  if (p1 == null && p2 == null) {
    return 0;
  }
  if (p1 == null) {
    return -1;
  }
  if (p2 == null) {
    return 1;
  }
  int comp=Double.compare(p1.getX(),p2.getX());
  if (comp != 0) {
    return comp;
  }
  comp=Double.compare(p1.getY(),p2.getY());
  if (comp != 0) {
    return comp;
  }
  comp=Double.compare(p1.getWeight(),p2.getWeight());
  if (comp != 0) {
    return comp;
  }
  return 0;
}
Program: 57160
Project: 57160
Buggy source:
/** 
 * Simple constructor.
 * @param center center of the ball
 * @param radius radius of the ball
 * @param support support points used to define the ball
 */
public EnclosingBall(final P center,final double radius,final P... support){
  this.center=center;
  this.radius=radius;
  this.support=support.clone();
}

Fixed version (ground truth):
/** 
 * Simple constructor.
 * @param center center of the ball
 * @param radius radius of the ball
 * @param support support points used to define the ball
 */
@SafeVarargs public EnclosingBall(final P center,final double radius,final P... support){
  this.center=center;
  this.radius=radius;
  this.support=support.clone();
}
Program: 57161
Project: 57161
Buggy source:
/** 
 * Build a convex region from a collection of bounding hyperplanes.
 * @param hyperplanes collection of bounding hyperplanes
 * @return a new convex region, or null if the collection is empty
 */
public Region<S> buildConvex(final Hyperplane<S>... hyperplanes){
  if ((hyperplanes == null) || (hyperplanes.length == 0)) {
    return null;
  }
  final Region<S> region=hyperplanes[0].wholeSpace();
  BSPTree<S> node=region.getTree(false);
  node.setAttribute(Boolean.TRUE);
  for (  final Hyperplane<S> hyperplane : hyperplanes) {
    if (node.insertCut(hyperplane)) {
      node.setAttribute(null);
      node.getPlus().setAttribute(Boolean.FALSE);
      node=node.getMinus();
      node.setAttribute(Boolean.TRUE);
    }
  }
  return region;
}

Fixed version (ground truth):
/** 
 * Build a convex region from a collection of bounding hyperplanes.
 * @param hyperplanes collection of bounding hyperplanes
 * @return a new convex region, or null if the collection is empty
 */
@SafeVarargs public final Region<S> buildConvex(final Hyperplane<S>... hyperplanes){
  if ((hyperplanes == null) || (hyperplanes.length == 0)) {
    return null;
  }
  final Region<S> region=hyperplanes[0].wholeSpace();
  BSPTree<S> node=region.getTree(false);
  node.setAttribute(Boolean.TRUE);
  for (  final Hyperplane<S> hyperplane : hyperplanes) {
    if (node.insertCut(hyperplane)) {
      node.setAttribute(null);
      node.getPlus().setAttribute(Boolean.FALSE);
      node=node.getMinus();
      node.setAttribute(Boolean.TRUE);
    }
  }
  return region;
}
Program: 57163
Project: 57163
Buggy source:
/** 
 * Timing.
 * @param repeatChunk Each timing measurement will done done for thatnumber of repeats of the code.
 * @param repeatStat Timing will be averaged over that number of runs.
 * @param runGC Call {@code System.gc()} between each timed block. Whenset to  {@code true}, the test will run much slower.
 * @param methods Codes being timed.
 * @return for each of the given {@code methods}, a  {@link StatisticalSummary} of the average times (in milliseconds)taken by a single call to the  {@code call} method (i.e. the timetaken by each timed block divided by  {@code repeatChunk}).
 */
public static StatisticalSummary[] time(int repeatChunk,int repeatStat,boolean runGC,Callable<Double>... methods){
  final double[][][] times=timesAndResults(repeatChunk,repeatStat,runGC,methods);
  final int len=methods.length;
  final StatisticalSummary[] stats=new StatisticalSummary[len];
  for (int j=0; j < len; j++) {
    final SummaryStatistics s=new SummaryStatistics();
    for (int k=0; k < repeatStat; k++) {
      s.addValue(times[j][k][0]);
    }
    stats[j]=s.getSummary();
  }
  return stats;
}

Fixed version (ground truth):
/** 
 * Timing.
 * @param repeatChunk Each timing measurement will done done for thatnumber of repeats of the code.
 * @param repeatStat Timing will be averaged over that number of runs.
 * @param runGC Call {@code System.gc()} between each timed block. Whenset to  {@code true}, the test will run much slower.
 * @param methods Codes being timed.
 * @return for each of the given {@code methods}, a  {@link StatisticalSummary} of the average times (in milliseconds)taken by a single call to the  {@code call} method (i.e. the timetaken by each timed block divided by  {@code repeatChunk}).
 */
@SafeVarargs public static StatisticalSummary[] time(int repeatChunk,int repeatStat,boolean runGC,Callable<Double>... methods){
  final double[][][] times=timesAndResults(repeatChunk,repeatStat,runGC,methods);
  final int len=methods.length;
  final StatisticalSummary[] stats=new StatisticalSummary[len];
  for (int j=0; j < len; j++) {
    final SummaryStatistics s=new SummaryStatistics();
    for (int k=0; k < repeatStat; k++) {
      s.addValue(times[j][k][0]);
    }
    stats[j]=s.getSummary();
  }
  return stats;
}
Program: 57164
Project: 57164
Buggy source:
public void testIsValid(){
  double[] xval=new double[]{3,4,5,6.5};
  double[] yval=new double[]{-4,-3,-1,2.5};
  double[] zval=new double[]{-12,-8,-5.5,-3,0,2.5};
  double[][][] fval=new double[xval.length][yval.length][zval.length];
  @SuppressWarnings("String_Node_Str") TricubicInterpolatingFunction tcf=new TricubicInterpolator().interpolate(xval,yval,zval,fval);
  Assert.assertTrue(tcf.isValidPoint(4,-3,-8));
  Assert.assertTrue(tcf.isValidPoint(5,-3,-8));
  Assert.assertTrue(tcf.isValidPoint(4,-1,-8));
  Assert.assertTrue(tcf.isValidPoint(5,-1,-8));
  Assert.assertTrue(tcf.isValidPoint(4,-3,0));
  Assert.assertTrue(tcf.isValidPoint(5,-3,0));
  Assert.assertTrue(tcf.isValidPoint(4,-1,0));
  Assert.assertTrue(tcf.isValidPoint(5,-1,0));
  Assert.assertFalse(tcf.isValidPoint(3.5,-3,-8));
  Assert.assertFalse(tcf.isValidPoint(4.5,-3.1,-8));
  Assert.assertFalse(tcf.isValidPoint(4.5,-2,0));
  Assert.assertFalse(tcf.isValidPoint(4.5,0,-3.5));
  Assert.assertFalse(tcf.isValidPoint(-10,4.1,-1));
}

Fixed version (ground truth):
public void testIsValid(){
  double[] xval=new double[]{3,4,5,6.5};
  double[] yval=new double[]{-4,-3,-1,2.5};
  double[] zval=new double[]{-12,-8,-5.5,-3,0,2.5};
  double[][][] fval=new double[xval.length][yval.length][zval.length];
  TricubicInterpolatingFunction tcf=new TricubicInterpolator().interpolate(xval,yval,zval,fval);
  Assert.assertTrue(tcf.isValidPoint(4,-3,-8));
  Assert.assertTrue(tcf.isValidPoint(5,-3,-8));
  Assert.assertTrue(tcf.isValidPoint(4,-1,-8));
  Assert.assertTrue(tcf.isValidPoint(5,-1,-8));
  Assert.assertTrue(tcf.isValidPoint(4,-3,0));
  Assert.assertTrue(tcf.isValidPoint(5,-3,0));
  Assert.assertTrue(tcf.isValidPoint(4,-1,0));
  Assert.assertTrue(tcf.isValidPoint(5,-1,0));
  Assert.assertFalse(tcf.isValidPoint(3.5,-3,-8));
  Assert.assertFalse(tcf.isValidPoint(4.5,-3.1,-8));
  Assert.assertFalse(tcf.isValidPoint(4.5,-2,0));
  Assert.assertFalse(tcf.isValidPoint(4.5,0,-3.5));
  Assert.assertFalse(tcf.isValidPoint(-10,4.1,-1));
}
Program: 57166
Project: 57166
Buggy source:
@Test public void testTetrahedron() throws MathArithmeticException {
  Vector3D vertex1=new Vector3D(1,2,3);
  Vector3D vertex2=new Vector3D(2,2,4);
  Vector3D vertex3=new Vector3D(2,3,3);
  Vector3D vertex4=new Vector3D(1,3,4);
  @SuppressWarnings("String_Node_Str") PolyhedronsSet tree=(PolyhedronsSet)new RegionFactory<Euclidean3D>().buildConvex(new Plane(vertex3,vertex2,vertex1,1.0e-10),new Plane(vertex2,vertex3,vertex4,1.0e-10),new Plane(vertex4,vertex3,vertex1,1.0e-10),new Plane(vertex1,vertex2,vertex4,1.0e-10));
  Assert.assertEquals(1.0 / 3.0,tree.getSize(),1.0e-10);
  Assert.assertEquals(2.0 * FastMath.sqrt(3.0),tree.getBoundarySize(),1.0e-10);
  Vector3D barycenter=(Vector3D)tree.getBarycenter();
  Assert.assertEquals(1.5,barycenter.getX(),1.0e-10);
  Assert.assertEquals(2.5,barycenter.getY(),1.0e-10);
  Assert.assertEquals(3.5,barycenter.getZ(),1.0e-10);
  double third=1.0 / 3.0;
  checkPoints(Region.Location.BOUNDARY,tree,new Vector3D[]{vertex1,vertex2,vertex3,vertex4,new Vector3D(third,vertex1,third,vertex2,third,vertex3),new Vector3D(third,vertex2,third,vertex3,third,vertex4),new Vector3D(third,vertex3,third,vertex4,third,vertex1),new Vector3D(third,vertex4,third,vertex1,third,vertex2)});
  checkPoints(Region.Location.OUTSIDE,tree,new Vector3D[]{new Vector3D(1,2,4),new Vector3D(2,2,3),new Vector3D(2,3,4),new Vector3D(1,3,3)});
}

Fixed version (ground truth):
@Test public void testTetrahedron() throws MathArithmeticException {
  Vector3D vertex1=new Vector3D(1,2,3);
  Vector3D vertex2=new Vector3D(2,2,4);
  Vector3D vertex3=new Vector3D(2,3,3);
  Vector3D vertex4=new Vector3D(1,3,4);
  PolyhedronsSet tree=(PolyhedronsSet)new RegionFactory<Euclidean3D>().buildConvex(new Plane(vertex3,vertex2,vertex1,1.0e-10),new Plane(vertex2,vertex3,vertex4,1.0e-10),new Plane(vertex4,vertex3,vertex1,1.0e-10),new Plane(vertex1,vertex2,vertex4,1.0e-10));
  Assert.assertEquals(1.0 / 3.0,tree.getSize(),1.0e-10);
  Assert.assertEquals(2.0 * FastMath.sqrt(3.0),tree.getBoundarySize(),1.0e-10);
  Vector3D barycenter=(Vector3D)tree.getBarycenter();
  Assert.assertEquals(1.5,barycenter.getX(),1.0e-10);
  Assert.assertEquals(2.5,barycenter.getY(),1.0e-10);
  Assert.assertEquals(3.5,barycenter.getZ(),1.0e-10);
  double third=1.0 / 3.0;
  checkPoints(Region.Location.BOUNDARY,tree,new Vector3D[]{vertex1,vertex2,vertex3,vertex4,new Vector3D(third,vertex1,third,vertex2,third,vertex3),new Vector3D(third,vertex2,third,vertex3,third,vertex4),new Vector3D(third,vertex3,third,vertex4,third,vertex1),new Vector3D(third,vertex4,third,vertex1,third,vertex2)});
  checkPoints(Region.Location.OUTSIDE,tree,new Vector3D[]{new Vector3D(1,2,4),new Vector3D(2,2,3),new Vector3D(2,3,4),new Vector3D(1,3,3)});
}
Program: 57167
Project: 57167
Buggy source:
/** 
 * Returns the solver absolute accuracy for inverse cumulative computation. You can override this method in order to use a Brent solver with an absolute accuracy different from the default.
 * @return the maximum absolute error in inverse cumulative probability estimates
 */
protected double getSolverAbsoluteAccuracy(){
  return solverAbsoluteAccuracy;
}

Fixed version (ground truth):
/** 
 * Returns the solver absolute accuracy for inverse cumulative computation. You can override this method in order to use a Brent solver with an absolute accuracy different from the default.
 * @return the maximum absolute error in inverse cumulative probability estimates
 */
protected double getSolverAbsoluteAccuracy(){
  return SOLVER_DEFAULT_ABSOLUTE_ACCURACY;
}
Program: 57169
Project: 57169
Buggy source:
/** 
 * Optimize an objective function. Optimization is considered to be a weighted least-squares minimization. The cost function to be minimized is <code>&sum;weight<sub>i</sub>(objective<sub>i</sub> - target<sub>i</sub>)<sup>2</sup></code>
 * @param f Objective function.
 * @param target Target value for the objective functions at optimum.
 * @param weights Weights for the least squares cost computation.
 * @param startPoint Start point for optimization.
 * @return the point/value pair giving the optimal value for objectivefunction.
 * @param maxEval Maximum number of function evaluations.
 * @throws org.apache.commons.math3.exception.DimensionMismatchException if the start point dimension is wrong.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException if the maximal number of evaluations is exceeded.
 * @throws org.apache.commons.math3.exception.NullArgumentException ifany argument is  {@code null}.
 * @deprecated As of 3.1. Please use{@link BaseAbstractMultivariateVectorOptimizer#optimize(int,MultivariateVectorFunction,OptimizationData[]) optimize(int,MultivariateDifferentiableVectorFunction,OptimizationData...)}instead.
 */
@Deprecated public PointVectorValuePair optimize(final int maxEval,final MultivariateDifferentiableVectorFunction f,final double[] target,final double[] weights,final double[] startPoint){
  return optimizeInternal(maxEval,f,new Target(target),new Weight(weights),new InitialGuess(startPoint));
}

Fixed version (ground truth):
/** 
 * Optimize an objective function. Optimization is considered to be a weighted least-squares minimization. The cost function to be minimized is <code>&sum;weight<sub>i</sub>(objective<sub>i</sub> - target<sub>i</sub>)<sup>2</sup></code>
 * @param f Objective function.
 * @param target Target value for the objective functions at optimum.
 * @param weights Weights for the least squares cost computation.
 * @param startPoint Start point for optimization.
 * @return the point/value pair giving the optimal value for objectivefunction.
 * @param maxEval Maximum number of function evaluations.
 * @throws org.apache.commons.math3.exception.DimensionMismatchException if the start point dimension is wrong.
 * @throws org.apache.commons.math3.exception.TooManyEvaluationsException if the maximal number of evaluations is exceeded.
 * @throws org.apache.commons.math3.exception.NullArgumentException ifany argument is  {@code null}.
 * @deprecated As of 3.1. Please use{@link BaseAbstractMultivariateVectorOptimizer#optimize(int,org.apache.commons.math3.analysis.MultivariateVectorFunction,OptimizationData[]) optimize(int,MultivariateDifferentiableVectorFunction,OptimizationData...)}instead.
 */
@Deprecated public PointVectorValuePair optimize(final int maxEval,final MultivariateDifferentiableVectorFunction f,final double[] target,final double[] weights,final double[] startPoint){
  return optimizeInternal(maxEval,f,new Target(target),new Weight(weights),new InitialGuess(startPoint));
}