How do I classify the improvement in performance when Hankel functions are replaced with log functions in MatLab?

I am working on a algorithm for acoustic scattering in two dimensions using MatLab, and one of the advantages of this algorithm is that Hankel functions can be replaced with log functions.

For example consider the following:

1. value = 0; tic; for t=1:100000, value = value + besselh(1,1,abs(1+1i)); end; toc
2. value = 0; tic; for t=1:100000, value = value + log(abs(1+1i)); end; toc

1) takes about 1.095455 seconds, whereas 2) takes about 0.043890 seconds.

Coming from a mathematics background I'm used to analyzing numerical methods in cases such as determining the order of convergence of an ODE/PDE solver or a numerical integration method, along with judging complexity in a program by counting operations.

However in this case, the number of operations is the same (on the surface anyway). So how can the improvement in efficiency be classified in this case? Are empiric results, such as showing that 2) takes much less time than 1), the best I can do in this situation?

Or is there a more formal/rigorous way to classify the improved efficiency?

• Right, the conclusion you can draw is that 1 is slower than 2, which is no surprise. There is nothing to be said about complexity, as there is no input size. An even less about efficiency. Lastly, you are comparing two different things. – Yves Daoust Apr 17 '17 at 16:31
• 1) Has this anything to do with Matlab, specifically? Because then it's offtopic. 2) What's the cost of evaluating besselh vs log? Benchmark the two in isolation! – Raphael Apr 17 '17 at 17:08
• @Raphael: hem, that's precisely what he did. – Yves Daoust Apr 17 '17 at 17:22
• @Raphael No it's not Matlab in general, I would be interested in how they compare in other languages also, C/C++ in particular. – csss Apr 27 '17 at 7:15