code: public boolean isIdentical( Polynomial p , double tol ) {
  		int m = Math.max(p.size(), size());
  
  		// make sure trailing coefficients are close to zero
  		for( int i = p.size; i < m; i++ ) {
  			if( Math.abs(c[i]) > tol ) {
  				return false;
  			}
  		}
  
  		for( int i = size; i < m; i++ ) {
  			if( Math.abs(p.c[i]) > tol ) {
  				return false;
  			}
  		}
  
  		// ensure that the rest of the coefficients are close
  		int n = Math.min(p.size(),size());
  		for( int i = 0; i < n; i++ ) {
  			if( Math.abs(c[i]-p.c[i]) > tol ) {
  				return false;
  			}
  		}
  
  		return true;
  	}
docs: Checks to see if the coefficients of two polynomials are identical to within tolerance.  If the lengths
  of the polynomials are not the same then the extra coefficients in the longer polynomial must be within tolerance
  of zero.
  
  @param p Polynomial that this polynomial is being compared against.
  @param tol Similarity tolerance.  Try 1e-15 for high confidence
  @return true if the two polynomials are identical to within tolerance.