Bug in QROMB.C?


richard_stanton
05-21-2005, 08:00 PM
In QROMB.C is the code:

if (j >= K) {
polint(&h[j-K],&s[j-K],K,0.0,&ss,&dss);
if (fabs(dss) <= EPS*fabs(ss)) return ss;
}

If j equals K, the first argument of polint will point to h[0], which has not been set to anything.

Saul Teukolsky
05-23-2005, 01:43 PM
Dear Richard,

The code is just passing the address of the start of the array in this case. However, polint itself never uses data in h[0], only from h[1] on.

Saul Teukolsky