#NEWLINE# def gamma( z , sqrt2pi = ( ( 2.0 * pi ) ** 0.5 ) ) : #NEWLINE# #INDENT# if ( z < 0.5 ) : #NEWLINE# #INDENT# return ( ( pi / sin ( ( pi * z ) ) ) / gamma ( ( 1.0 - z ) ) ) #NEWLINE# #UNINDENT# az = ( z + ( 7.0 - 0.5 ) ) #NEWLINE# return ( ( ( ( az ** ( z - 0.5 ) ) / exp ( az ) ) * sqrt2pi ) * fsum ( [ 0.9999999999995183 , ( 676.5203681218835 / z ) , ( ( - 1259.139216722289 ) / ( z + 1.0 ) ) , ( 771.3234287757674 / ( z + 2.0 ) ) , ( ( - 176.6150291498386 ) / ( z + 3.0 ) ) , ( 12.50734324009056 / ( z + 4.0 ) ) , ( ( - 0.1385710331296526 ) / ( z + 5.0 ) ) , ( 9.934937113930748e-06 / ( z + 6.0 ) ) , ( 1.659470187408462e-07 / ( z + 7.0 ) ) ] ) )