index使うよりもHashに順位を取っておいて

a = [ 1.0, 3.0, 4.2, 2.5 ]
h = {}
a.sort.each_with_index{|e, i| h[e] = i}

p h.values_at(*a)

のほうが速かった