I wonder if it makes more sense to have `public double apply(double n)` on each of the different enum types? That way I guess they can be much better inlined and you don't have to do the swtich altogether?