Hmm, do we need to care about possible overflow here on the *2 ? We could write it as:
```
depth = (cast(ptrdiff_t)depth < 0) ? (depth / 3) * 2 : (depth * 2) / 3;
```