Move utility functions from Filter.c to the mathnum module.