code: public void exceptionalShift( int x1 , int x2) {
           if( printHumps )
              System.out.println("Performing exceptional implicit double step");
  
          // perform a random shift that is of the same magnitude as the matrix
          double val = Math.abs(A.get(x2,x2));
  
          if( val == 0 )
              val = 1;
  
          numExceptional++;
          // the closer the value is the better it handles identical eigenvalues cases
          double p = 1.0 - Math.pow(0.1,numExceptional);
          val *= p+2.0*(1.0-p)*(rand.nextDouble()-0.5);
  
          if( rand.nextBoolean() )
              val = -val;
  
          performImplicitSingleStep(x1,x2,val);
  
          lastExceptional = steps;
      }
docs: Perform a shift in a random direction that is of the same magnitude as the elements in the matrix.