Something that's missing is bounds tracking. The constants place a range bound on the distributions, changing them. Tracking bounds is fun. But it might be more efficient to start by simply solving for the extra uniform value that has the widest range. Later, instances of states or whatnot could possibly have known constraints placed on them. I'm a little worried that solving for the widest range could alter the distribution sampled from, making it incorrect. Maybe a more accurate approach might be to sample from the distribution of the sums, then from the distributions that could produce that, until the final sample is identified. Code that does that could be optimized for different encountered equations, or reviewed for a general optimisation. So "solving for the widest range" could be considered a heuristic, to provide a value-tracking structure to open up options of design.