Typed representation of numerical functions