function deriveBoundingRegion(rootRegion, level, x, y, z) {
  //>>includeStart('debug', pragmas.debug);
  Check.typeOf.object("rootRegion", rootRegion);
  Check.typeOf.number("level", level);
  Check.typeOf.number("x", x);
  Check.typeOf.number("y", y);
  if (defined(z)) {
    Check.typeOf.number("z", z);
  }
  //>>includeEnd('debug');

  if (level === 0) {
    return rootRegion.slice();
  }

  const rectangle = Rectangle.unpack(rootRegion, 0, scratchRectangle);
  const rootMinimumHeight = rootRegion[4];
  const rootMaximumHeight = rootRegion[5];
  const tileScale = Math.pow(2, -level);

  const childWidth = tileScale * rectangle.width;
  const west = CesiumMath.negativePiToPi(rectangle.west + x * childWidth);
  const east = CesiumMath.negativePiToPi(west + childWidth);

  const childHeight = tileScale * rectangle.height;
  const south = CesiumMath.negativePiToPi(rectangle.south + y * childHeight);
  const north = CesiumMath.negativePiToPi(south + childHeight);

  // Height is only subdivided for octrees; It remains constant for quadtrees.
  let minimumHeight = rootMinimumHeight;
  let maximumHeight = rootMaximumHeight;
  if (defined(z)) {
    const childThickness = tileScale * (rootMaximumHeight - rootMinimumHeight);
    minimumHeight += z * childThickness;
    maximumHeight = minimumHeight + childThickness;
  }

  return [west, south, east, north, minimumHeight, maximumHeight];
}
Derive a bounding volume for a descendant tile (child, grandchild, etc.),
assuming a quadtree or octree implicit tiling scheme. The (level, x, y, [z])
coordinates are given to select the descendant tile and compute its position
and dimensions.
<p>
If z is present, octree subdivision is used. Otherwise, quadtree subdivision
is used. Quadtrees are always divided at the midpoint of the the horizontal
dimensions, i.e. (mid_longitude, mid_latitude), leaving the height values
unchanged.
</p>
<p>
This computes the child volume directly from the root bounding volume rather
than recursively subdividing to minimize floating point error.
</p>
@param {number[]} rootRegion An array of 6 numbers representing the root implicit tile
@param {number} level The level of the descendant tile relative to the root implicit tile
@param {number} x The x coordinate of the descendant tile
@param {number} y The x coordinate of the descendant tile
@param {number} [z] The z coordinate of the descendant tile (octree only)
@returns {number[]} An array of 6 numbers representing the bounding region of the descendant tile
@private