Ratfn ratlsq(Doub fn(const Doub), const Doub a, const Doub b, const Int mm, const Int kk, Doub &dev) { const Int NPFAC=8,MAXIT=5; const Doub BIG=1.0e99,PIO2=1.570796326794896619; Int i,it,j,ncof=mm+kk+1,npt=NPFAC*ncof; Doub devmax,e,hth,power,sum; VecDoub bb(npt),coff(ncof),ee(npt),fs(npt),wt(npt),xs(npt); MatDoub u(npt,ncof); Ratfn ratbest(coff,mm+1,kk+1); dev=BIG; for (i=0;i devmax) devmax=wt[j]; } e=sum/npt; if (devmax <= dev) { ratbest = rat; dev=devmax; } cout << " ratlsq iteration= " << it; cout << " max error= " << setw(10) << devmax << endl; } return ratbest; }