function retval=funcOPLSQR(a,xx)
# Orthogonal polynomial function calculator
yy=0.0;
m=length(a);
mp2=m+2;
q=zeros(mp2,1);
for k=m-1:-1:1
  q(k)=a(1,k)+(xx-a(2,k+1))*q(k+1,1)-a(3,k+1)*q(k+2,1);
  yy=q(k);
endfor
retval=yy;
endfunction