ang[1]=atan(b);
ang[3]=0.0;
ang[4]=ang[1];
ang[5]=POTN;
for (j=3;j<6;j++) ch[j]=chixy.get(ang[j]);
brent.bracket(ang[0],ang[1],chixy);
ang[0] = brent.ax; ang[1] = brent.bx; ang[2] = brent.cx;
ch[0] = brent.fa; ch[1] = brent.fb; ch[2] = brent.fc;
b = brent.minimize(chixy);
chi2=chixy.get(b);
a=aa;