function _cbrtComplex(x, allRoots) {
    // https://www.wikiwand.com/en/Cube_root#/Complex_numbers
    var arg3 = x.arg() / 3;
    var abs = x.abs(); // principal root:

    var principal = new type.Complex(_cbrtNumber(abs), 0).mul(new type.Complex(0, arg3).exp());

    if (allRoots) {
      var all = [principal, new type.Complex(_cbrtNumber(abs), 0).mul(new type.Complex(0, arg3 + Math.PI * 2 / 3).exp()), new type.Complex(_cbrtNumber(abs), 0).mul(new type.Complex(0, arg3 - Math.PI * 2 / 3).exp())];
      return config.matrix === 'Array' ? all : matrix(all);
    } else {
      return principal;
    }
  }
Calculate the cubic root for a complex number
@param {Complex} x
@param {boolean} [allRoots]   If true, the function will return an array
                              with all three roots. If false or undefined,
                              the principal root is returned.
@returns {Complex | Array.<Complex> | Matrix.<Complex>} Returns the cubic root(s) of x
@private