code: public static void residuals_Control4( DMatrixRMaj L_full , DMatrixRMaj y ,
  										   double beta[] , double r[] )
  	{
  		double b0 = beta[0]; double b1 = beta[1]; double b2 = beta[2]; double b3 = beta[3];
  
  		final double ld[] = L_full.data;
  
  		for( int i = 0; i < 6; i++ ) {
  			int li = L_full.numCols*i;
  			double residual = -y.data[i];
  			residual += ld[li++]*b0*b0;
  			residual += ld[li++]*b0*b1;
  			residual += ld[li++]*b0*b2;
  			residual += ld[li++]*b0*b3;
  			residual += ld[li++]*b1*b1;
  			residual += ld[li++]*b1*b2;
  			residual += ld[li++]*b1*b3;
  			residual += ld[li++]*b2*b2;
  			residual += ld[li++]*b2*b3;
  			residual += ld[li  ]*b3*b3;
  
  			r[i] = residual;
  		}
  	}
docs: Computes the residuals (difference between observed and predicted) given 4 control points.