That call "return sqrt(f);" should have been "return sqrt!F(f)" that forwards to sqrt functions that take floats/doubles/reals. Again these would be templates.. it's a shame templates still can't overload against functions.