Program: 61192
Project: 61192
Buggy source:
private void tred2(){
  d.assign(v.viewColumn(n - 1));
  for (int i=n - 1; i > 0; i--) {
    double scale=d.norm(1);
    double h=0.0;
    if (scale == 0.0) {
      e.setQuick(i,d.getQuick(i - 1));
      for (int j=0; j < i; j++) {
        d.setQuick(j,v.getQuick(i - 1,j));
        v.setQuick(i,j,0.0);
        v.setQuick(j,i,0.0);
      }
    }
 else {
      for (int k=0; k < i; k++) {
        d.setQuick(k,d.getQuick(k) / scale);
        h+=d.getQuick(k) * d.getQuick(k);
      }
      double f=d.getQuick(i - 1);
      double g=Math.sqrt(h);
      if (f > 0) {
        g=-g;
      }
      e.setQuick(i,scale * g);
      h=h - f * g;
      d.setQuick(i - 1,f - g);
      for (int j=0; j < i; j++) {
        e.setQuick(j,0.0);
      }
      for (int j=0; j < i; j++) {
        f=d.getQuick(j);
        v.setQuick(j,i,f);
        g=e.getQuick(j) + v.getQuick(j,j) * f;
        for (int k=j + 1; k <= i - 1; k++) {
          g+=v.getQuick(k,j) * d.getQuick(k);
          e.setQuick(k,e.getQuick(k) + v.getQuick(k,j) * f);
        }
        e.setQuick(j,g);
      }
      f=0.0;
      for (int j=0; j < i; j++) {
        e.setQuick(j,e.getQuick(j) / h);
        f+=e.getQuick(j) * d.getQuick(j);
      }
      double hh=f / (h + h);
      for (int j=0; j < i; j++) {
        e.setQuick(j,e.getQuick(j) - hh * d.getQuick(j));
      }
      for (int j=0; j < i; j++) {
        f=d.getQuick(j);
        g=e.getQuick(j);
        for (int k=j; k <= i - 1; k++) {
          v.setQuick(k,j,v.getQuick(k,j) - (f * e.getQuick(k) + g * d.getQuick(k)));
        }
        d.setQuick(j,v.getQuick(i - 1,j));
        v.setQuick(i,j,0.0);
      }
    }
    d.setQuick(i,h);
  }
  for (int i=0; i < n - 1; i++) {
    v.setQuick(n - 1,i,v.getQuick(i,i));
    v.setQuick(i,i,1.0);
    double h=d.getQuick(i + 1);
    if (h != 0.0) {
      for (int k=0; k <= i; k++) {
        d.setQuick(k,v.getQuick(k,i + 1) / h);
      }
      for (int j=0; j <= i; j++) {
        double g=0.0;
        for (int k=0; k <= i; k++) {
          g+=v.getQuick(k,i + 1) * v.getQuick(k,j);
        }
        for (int k=0; k <= i; k++) {
          v.setQuick(k,j,v.getQuick(k,j) - g * d.getQuick(k));
        }
      }
    }
    for (int k=0; k <= i; k++) {
      v.setQuick(k,i + 1,0.0);
    }
  }
  d.assign(v.viewRow(n - 1));
  v.viewRow(n - 1).assign(0);
  v.setQuick(n - 1,n - 1,1.0);
  e.setQuick(0,0.0);
}

Fixed version (ground truth):
private void tred2(){
  d.assign(v.viewColumn(n - 1));
  for (int i=n - 1; i > 0; i--) {
    double scale=d.viewPart(0,i).norm(1);
    double h=0.0;
    if (scale == 0.0) {
      e.setQuick(i,d.getQuick(i - 1));
      for (int j=0; j < i; j++) {
        d.setQuick(j,v.getQuick(i - 1,j));
        v.setQuick(i,j,0.0);
        v.setQuick(j,i,0.0);
      }
    }
 else {
      for (int k=0; k < i; k++) {
        d.setQuick(k,d.getQuick(k) / scale);
        h+=d.getQuick(k) * d.getQuick(k);
      }
      double f=d.getQuick(i - 1);
      double g=Math.sqrt(h);
      if (f > 0) {
        g=-g;
      }
      e.setQuick(i,scale * g);
      h=h - f * g;
      d.setQuick(i - 1,f - g);
      for (int j=0; j < i; j++) {
        e.setQuick(j,0.0);
      }
      for (int j=0; j < i; j++) {
        f=d.getQuick(j);
        v.setQuick(j,i,f);
        g=e.getQuick(j) + v.getQuick(j,j) * f;
        for (int k=j + 1; k <= i - 1; k++) {
          g+=v.getQuick(k,j) * d.getQuick(k);
          e.setQuick(k,e.getQuick(k) + v.getQuick(k,j) * f);
        }
        e.setQuick(j,g);
      }
      f=0.0;
      for (int j=0; j < i; j++) {
        e.setQuick(j,e.getQuick(j) / h);
        f+=e.getQuick(j) * d.getQuick(j);
      }
      double hh=f / (h + h);
      for (int j=0; j < i; j++) {
        e.setQuick(j,e.getQuick(j) - hh * d.getQuick(j));
      }
      for (int j=0; j < i; j++) {
        f=d.getQuick(j);
        g=e.getQuick(j);
        for (int k=j; k <= i - 1; k++) {
          v.setQuick(k,j,v.getQuick(k,j) - (f * e.getQuick(k) + g * d.getQuick(k)));
        }
        d.setQuick(j,v.getQuick(i - 1,j));
        v.setQuick(i,j,0.0);
      }
    }
    d.setQuick(i,h);
  }
  for (int i=0; i < n - 1; i++) {
    v.setQuick(n - 1,i,v.getQuick(i,i));
    v.setQuick(i,i,1.0);
    double h=d.getQuick(i + 1);
    if (h != 0.0) {
      for (int k=0; k <= i; k++) {
        d.setQuick(k,v.getQuick(k,i + 1) / h);
      }
      for (int j=0; j <= i; j++) {
        double g=0.0;
        for (int k=0; k <= i; k++) {
          g+=v.getQuick(k,i + 1) * v.getQuick(k,j);
        }
        for (int k=0; k <= i; k++) {
          v.setQuick(k,j,v.getQuick(k,j) - g * d.getQuick(k));
        }
      }
    }
    for (int k=0; k <= i; k++) {
      v.setQuick(k,i + 1,0.0);
    }
  }
  d.assign(v.viewRow(n - 1));
  v.viewRow(n - 1).assign(0);
  v.setQuick(n - 1,n - 1,1.0);
  e.setQuick(0,0.0);
}