fix for issue #713

It was just an error when copying the formula. I added also a test with the specific sample used to unveil the error.

There is also another commit with extra funcs in npymath_exports, but they do no harm