function main (arr, N, prec = config.relTol, type, computeVectors) {
    if (type === 'number') {
      return diag(arr, prec, computeVectors)
    }

    if (type === 'BigNumber') {
      return diagBig(arr, prec, computeVectors)
    }

    throw TypeError('Unsupported data type: ' + type)
  }
@param {number[] | BigNumber[]} arr
@param {number} N
@param {number} prec
@param {'number' | 'BigNumber'} type