The code pattern
f(args..., symbol) = f(args..., Val(symbol))
should be removed from the code (1, 2 and 3) as it greatly affects performance. Or at least we should change definitions as follows
f(args...) = f(args..., Val(:real))
to maintain performance where it counts.