Lines Matching refs:p
22 def fast_exp2(x, p): argument
24 p = p.astype(np.float32)
27 y = (((((p[0]*x) + p[1])*x + p[2])*x + p[3])*x + p[4])*x + 1
35 p = np.polyfit(x, ((2 ** (x/16)) - 1) / x, 4)
36 y = [ fast_exp2(x[i], p) for i in range(len(x)) ]
40 .format(p[0], p[1], p[2], p[3], p[4]))
57 def fast_log2(x, p): argument
59 p = p.astype(np.float32)
64 y = ((((p[0]*x) + p[1])*x + p[2])*x + p[3])*x + p[4]
71 p = np.polyfit(x, np.log2(x), 4)
74 y = [ fast_log2(x[i], p) for i in range(len(x)) ]
78 .format(p[0], p[1], p[2], p[3], p[4]))