by bscottmay · 2y ago · 0 comments
import numpy as np
l = 10_000
t = np.empty(l, dtype=np.float32)
j = np.arange(l)
t = 0.02 \* j
t *= (0.03 * j)
t -= (0.04 \* j)
t /= 0.05 \* (j + 1)The fact that they ran the C code without the optimisation flags and compared it that way makes me think Javascript was what they actually wanted to write this one in anyway.