def cdf(x, iterations=300):
 product = 1.0
 taylor_exp = [x]
 for i in range(3, iterations, 2):
  product *= i
  taylor_exp.append((float((x ** i)) / product))
 taylor_fact = sum(taylor_exp)
 return (0.5 + (taylor_fact * std_normal_pdf.pdf(x, mean=0, std_dev=1)))

def cdf ( x , iterations = 300 ) : product = 1.0 taylor_exp = [ x ] for i in range ( 3 , iterations , 2 ) : product *= i taylor_exp . append ( ( float ( ( x ** i ) ) / product ) ) taylor_fact = sum ( taylor_exp ) return ( 0.5 + ( taylor_fact * std_normal_pdf . pdf ( x , mean = 0 , std_dev = 1 ) ) )
returns the cumulative distribution function at x .