So the equation is four 6-sided dice, keep the highest three results of the four results, and reroll any ones rolled. However the exception comes in where the reroll won't happen if there are already three results higher than a one, so only if there are two 1s rolled.
I am not certain if this is the right stackexchange for this question, but i can't find any auto statistic calculators online that can apply this exception. Anyone's know what the average and deviation would be?
An example below:
(4, 2, 4, 1) = 10 -> the 1 is dropped and not rerolled because there are 3 results higher than 1
(5, 2, 2, 4) = 11 -> one of the 2s is dropped and no rerolls because a 1 was not rolled
(1, 2, 2, 1, [1, 6]) = 10 -> two 1s were rolled and got rerolled into a 1 and 6, the new 1 is not rolled because you now have 3 results higher than 1.
This can be expressed using my Icepool library as such:
Result:
Mean: 12.824477686989315 SD: 2.5054380002701975
Die with denominator 9744875