cython implementation of calc and evaluation module