Benchmark.bm(10) do |t| t.report('**_pow'){ 1_000_000.times{1.5 ** 3.0} } t.report('fast_pow'){ 1_000_000.times{fast_pow(1.5, 3.0)} } t.report('fast_pow2'){ 1_000_000.times{fast_pow2(1.5, 3.0)} } a = 1.5 t.report('init_bits'){ 1_000_000.times{x = a.int_bits} } b = 3.0 y = 0.06197100837140948 t.report('get_from'){ 1_000_000.times{Float.get_from_int_bits(((b + 0x7f - y) * SHIFT23).to_i)} } end