For a project, I need to calculate the overlap volume of two overlapping ellipsoids in 3D. The method itself isn't a problem: I'm basically picking random points within a bounding box and checking whether they're in both ellipsoids simultaneously.
In my never-ending quest to optimize the program in terms of runtime, a smaller bounding box would obviously be advantageous. Right now, the "box" is a sphere which is centered around the midpoint between the ellipsoids' centers of mass and has a diameter corresponding to the longest ellipsoid axis. This is completely arbitrary and I'm fairly certain the overlapping volume will always be contained in this sphere, but I'd really like to find some way to optimize the entire process.
Is there some general method to optimize the bounding volume?
Isn't this a math problem, rather than a CS problem? What you seem to be asking for is a formula defining the possible overlap of two ellipsoids. You intend to use that formula to make your code more efficient, sure, but that is not related to the core question as far as I can tell. If you had the formula and were trying to figure out how to write it as code, that would be another story. Maybe you should consider posting this to https://math.stackexchange.com/
It seems to me you can redefine your question as "What is formula defining the volume where overlap is possible between 2 ellipsoids in a 3D space?", and that has no reference to computing whatsoever.