Program: 57080
Project: 57080
Buggy source:
/** 
 * Returns the natural logarithm of a. a is first split into three parts such that  a = (10000^h)(2^j)k. ln(a) is computed by ln(a) = ln(5)*h + ln(2)*(h+j) + ln(k) k is in the range 2/3 < k <4/3 and is passed on to a series expansion.
 * @param a number from which logarithm is requested
 * @return log(a)
 */
public static Dfp log(Dfp a){
  int lr;
  Dfp x;
  int ix;
  int p2=0;
  if (a.equals(a.getZero()) || a.lessThan(a.getZero()) || a.isNaN()) {
    a.getField().setIEEEFlagsBits(DfpField.FLAG_INVALID);
    return a.dotrap(DfpField.FLAG_INVALID,"String_Node_Str",a,a.newInstance((byte)1,Dfp.QNAN));
  }
  if (a.classify() == Dfp.INFINITE) {
    return a;
  }
  x=new Dfp(a);
  lr=x.log10K();
  x=x.divide(pow(a.newInstance(10000),lr));
  ix=x.floor().intValue();
  while (ix > 2) {
    ix>>=1;
    p2++;
  }
  Dfp[] spx=split(x);
  Dfp[] spy=new Dfp[2];
  spy[0]=pow(a.getTwo(),p2);
  spx[0]=spx[0].divide(spy[0]);
  spx[1]=spx[1].divide(spy[0]);
  spy[0]=a.newInstance("String_Node_Str");
  while (spx[0].add(spx[1]).greaterThan(spy[0])) {
    spx[0]=spx[0].divide(2);
    spx[1]=spx[1].divide(2);
    p2++;
  }
  Dfp[] spz=logInternal(spx);
  spx[0]=a.newInstance(new StringBuilder().append(p2 + 4 * lr).toString());
  spx[1]=a.getZero();
  spy=splitMult(a.getField().getLn2Split(),spx);
  spz[0]=spz[0].add(spy[0]);
  spz[1]=spz[1].add(spy[1]);
  spx[0]=a.newInstance(new StringBuilder().append(4 * lr).toString());
  spx[1]=a.getZero();
  spy=splitMult(a.getField().getLn5Split(),spx);
  spz[0]=spz[0].add(spy[0]);
  spz[1]=spz[1].add(spy[1]);
  return a.newInstance(spz[0].add(spz[1]));
}

Fixed version (ground truth):
/** 
 * Returns the natural logarithm of a. a is first split into three parts such that   {@code a = (10000^h)(2^j)k}. ln(a) is computed by   {@code ln(a) = ln(5)*h + ln(2)*(h+j) + ln(k)}. k is in the range   {@code 2/3 < k <4/3} and is passed on to a series expansion.
 * @param a number from which logarithm is requested
 * @return log(a)
 */
public static Dfp log(Dfp a){
  int lr;
  Dfp x;
  int ix;
  int p2=0;
  if (a.equals(a.getZero()) || a.lessThan(a.getZero()) || a.isNaN()) {
    a.getField().setIEEEFlagsBits(DfpField.FLAG_INVALID);
    return a.dotrap(DfpField.FLAG_INVALID,"String_Node_Str",a,a.newInstance((byte)1,Dfp.QNAN));
  }
  if (a.classify() == Dfp.INFINITE) {
    return a;
  }
  x=new Dfp(a);
  lr=x.log10K();
  x=x.divide(pow(a.newInstance(10000),lr));
  ix=x.floor().intValue();
  while (ix > 2) {
    ix>>=1;
    p2++;
  }
  Dfp[] spx=split(x);
  Dfp[] spy=new Dfp[2];
  spy[0]=pow(a.getTwo(),p2);
  spx[0]=spx[0].divide(spy[0]);
  spx[1]=spx[1].divide(spy[0]);
  spy[0]=a.newInstance("String_Node_Str");
  while (spx[0].add(spx[1]).greaterThan(spy[0])) {
    spx[0]=spx[0].divide(2);
    spx[1]=spx[1].divide(2);
    p2++;
  }
  Dfp[] spz=logInternal(spx);
  spx[0]=a.newInstance(new StringBuilder().append(p2 + 4 * lr).toString());
  spx[1]=a.getZero();
  spy=splitMult(a.getField().getLn2Split(),spx);
  spz[0]=spz[0].add(spy[0]);
  spz[1]=spz[1].add(spy[1]);
  spx[0]=a.newInstance(new StringBuilder().append(4 * lr).toString());
  spx[1]=a.getZero();
  spy=splitMult(a.getField().getLn5Split(),spx);
  spz[0]=spz[0].add(spy[0]);
  spz[1]=spz[1].add(spy[1]);
  return a.newInstance(spz[0].add(spz[1]));
}