If you can live with changing the signature from two tuples to just taking the four floats, you'll see a big further improvement --- these are the only lines showing up yellow when running the code through cython -a: https://rawgit.com/syllog1sm/a13542690c59d5e60ebf/raw/499418...