math utils for HEP software