added functions for creating mathematical expressions that are evaluated at the sample level