function jordanBase2x2 (a, b, c, d, l1, l2, prec, type) {
    const big = type === 'BigNumber'
    const cplx = type === 'Complex'

    const zero = big ? bignumber(0) : cplx ? complex(0) : 0
    const one = big ? bignumber(1) : cplx ? complex(1) : 1

    // matrix is already upper triangular
    // return an identity matrix
    if (smaller(abs(c), prec)) {
      return [[one, zero], [zero, one]]
    }

    // matrix is diagonalizable
    // return its eigenvectors as columns
    if (larger(abs(subtract(l1, l2)), prec)) {
      return [[subtract(l1, d), subtract(l2, d)], [c, c]]
    }

    // matrix is not diagonalizable
    // compute diagonal elements of N = A - lambdaI
    const na = subtract(a, l1)
    const nd = subtract(d, l1)

    // col(N,2) = 0  implies  S = ( col(N,1), e_1 )
    // col(N,2) != 0 implies  S = ( col(N,2), e_2 )

    if (smaller(abs(b), prec) && smaller(abs(nd), prec)) {
      return [[na, one], [c, zero]]
    } else {
      return [[b, zero], [nd, one]]
    }
  }
For an 2x2 matrix compute the transformation matrix S,
so that SAS^-1 is an upper triangular matrix
@return {[[number,number],[number,number]]}
@see https://math.berkeley.edu/~ogus/old/Math_54-05/webfoils/jordan.pdf
@see http://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html