I have a 6-coloured cube, something like below:

The cube can only rotate in 90° increments around any of the three axes. Rotations are defined as 3-dimensional vectors $(x, y, z)$, where each element represents the rotation angle (multiple of 90°) around that axis (with the $x$ axis being left-to-right, $y$ being top-to-bottom, and $z$ front-to-back). The rotations are executed sequentially in the order $x$, $y$, $z$.
I'm given some initial state (represented by 6 letters that describe the face colours in top->left->front->right->back->bottom order) at the initial $(0, 0, 0)$ rotation. For instance, the above cube could have the initial state WGYBRO, meaning the white face is facing upwards, the green face left, the yellow front, the blue right, the red backwards, and the orange (not visible in the above image) downwards.
Now, I am given the colours of three arbitrary faces of the cube, one per axis. In other words, I am given the colours of: either the left or right face, the top or bottom face, and the front or back face. This could be represented by colours in $x$, $y$, $z$ order, with a prime meaning the face is on the far side of the axis, e.g. G'YW meaning the right face is green, the top face is yellow, and the front face is white.
I am looking for a way to determine:
- whether this given state is reachable from the initial state via rotations alone (no mirroring); and
- the rotation $(x, y, z)$ that can be applied to the cube in the initial state to achieve the given state.
I'd like to find a way to do this without just trying every possible rotation vector and seeing whether one of them works. The initial approach I thought of was to simply rotate around $x$ so that the front/back face fits, then rotate around $y$ so the left/right face fits, and finally rotate around $z$ so the top/bottom face fits. However, the subsequent rotations can obviously invalidate the previous matches, so this approach doesn't work.
A solution using quaternions instead of the $(x,y,z)$ rotations would be acceptable too.