def __contfractbeta(a, b, x, ITMAX=<NUM_LIT:200>):
EPS = <NUM_LIT><EOL>bm = az = am = <NUM_LIT:1.0><EOL>qab = a + b<EOL>qap = a + <NUM_LIT:1.0><EOL>qam = a - <NUM_LIT:1.0><EOL>bz = <NUM_LIT:1.0> - qab * x / qap<EOL>for i in range(ITMAX + <NUM_LIT:1>):<EOL><INDENT>em = float(i + <NUM_LIT:1>)<EOL>tem = em + em<EOL>d = em * (b - em) * x / ((qam + tem) * (a + tem))<EOL>ap = az + d * am<EOL>bp = bz + d * bm<EOL>d = -(a + em) * (qab + em) * x / ((qap + tem) * (a + tem))<EOL>app = ap + d * az<EOL>bpp = bp + d * bz<EOL>aold = az<EOL>am = ap / bpp<EOL>bm = bp / bpp<EOL>az = app / bpp<EOL>bz = <NUM_LIT:1.0><EOL>if (abs(az - aold) < (EPS * abs(az))):<EOL><INDENT>return az<EOL><DEDENT><DEDENT>raise PyokitError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>
contfractbeta() evaluates the continued fraction form of the incomplete
Beta function; incompbeta(). (Code translated from: Numerical Recipes in C.)