code: public static double calculateScaledResidual(DoubleMatrix2D A, DoubleMatrix1D x, DoubleMatrix1D b){
  		double residual = -Double.MAX_VALUE;
  		double nix = Algebra.DEFAULT.normInfinity(x);
  		double nib = Algebra.DEFAULT.normInfinity(b);
  		if(Double.compare(nix, 0.)==0 && Double.compare(nib, 0.)==0){
  			return 0;
  		}else{
  			double num = Algebra.DEFAULT.normInfinity(ColtUtils.zMult(A, x, b, -1));
  			double den = Algebra.DEFAULT.normInfinity(A) * nix + nib;
  			residual =  num / den;
  			//log.debug("scaled residual: " + residual);
  			
  			return residual;
  		}
  	}
docs: Calculate the scaled residual
  <br> ||Ax-b||_oo/( ||A||_oo . ||x||_oo + ||b||_oo ), with
  <br> ||x||_oo = max(||x[i]||)