Still quite a round-about way of generating the primitive functions for the math library. I suggest that we directly write the primitive functions to the code array, using a for_each on primitives.
Another issue: math_max and math_min also have variable arity.
...and
math_hypot
.