With dicelab you can express most dice rolls (and similar things) in a functional language, and the either roll the expression, or evaulate the statistical distribution. In the latter case you can choose whether you want to simply roll and tally many times, or actually compute the distribution (which is more precise, but takes a long time in some obscure cases).