Fix buildbots errors introduced with the registration module

Most failures are caused because "__isinf" is not defined in Visual C. Here, I am using cimport from libc.math (the library provided by cython) instead of importing directly from math.h.
I think here by enabling the gil from inside isinf you will lose performance (because you are inside nested for loops).