function [e,J,g,w_next]=x_sq_std(wini,rate); x=-1:.1:1; t=x.^2; inp=[x' ones(21,1)]; y=inp*wini; e=t'-y; J=inp; g=-e'*J; w_next=wini-g'*rate;