def tailProbability(x, distributionParams):
if "<STR_LIT>" not in distributionParams or "<STR_LIT>" not in distributionParams:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>if x < distributionParams["<STR_LIT>"]:<EOL><INDENT>xp = <NUM_LIT:2> * distributionParams["<STR_LIT>"] - x<EOL>return tailProbability(xp, distributionParams)<EOL><DEDENT>z = (x - distributionParams["<STR_LIT>"]) / distributionParams["<STR_LIT>"]<EOL>return <NUM_LIT:0.5> * math.erfc(z/<NUM_LIT>)<EOL>
Given the normal distribution specified by the mean and standard deviation
in distributionParams, return the probability of getting samples further
from the mean. For values above the mean, this is the probability of getting
samples > x and for values below the mean, the probability of getting
samples < x. This is the Q-function: the tail probability of the normal distribution.

:param distributionParams: dict with 'mean' and 'stdev' of the distribution