Created
November 10, 2017 16:06
-
-
Save cicdw/b5f95e6ade28f18e1ca390d9711cb21f to your computer and use it in GitHub Desktop.
Code snippets for Medium blog post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numba import guvectorize | |
@guvectorize('i8, f8, f8, b1, f8[:], f8[:]', | |
'(), (), (), (), (s) -> (s)') | |
def fast_predict_over_time(x, y, z, overlay, _, out): | |
adj = 1.5 if overlay else 1.0 | |
for t in range(len(out)): | |
out[t] = adj * (t * x ** 2 + y - 2 * z - 2 * t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment