Two index computations differing in execution time
These two statements are functionally identical:

idx_velo_avg = (size_t)((velo_avg) * (funmaps_velo-&gt;map_velo_step_recip) + 0.5);

idx_velo_eff = (size_t)((velo_eff) * (funmaps_velo-&gt;map_velo_step_recip) + 0.5);


The only difference is the variable on the left side of the multiplication. Since velo_eff is calculated just before the second of these statements, we can safely assume that the slowdown isn't caused by a cache miss.

So I think the only possible explanation is that the processor has to wait for the result of the square root calculation to emerge from the processing pipeline before it can start calculating idx_velo_eff.

Try calculating the square root first, and see if that helps:

velo_eff = sqrt(velo_pos_k * velo_pos_k + accel * delta_s);
idx_velo_avg = equidIND(velo_avg, funmaps_velo-&gt;map_velo_step_recip);
idx_velo_eff = equidIND(velo_eff, funmaps_velo-&gt;map_velo_step_recip);


Also, check your compiler optimization settings. A decent compiler should be able to do this sort of thing for you.