int fa_estimate_sf_fast_improve(float T, float t, float miu2) {
  float ratio;
  int sf;
  if (t > 0) {
    ratio = T / (t * sqrt(miu2 * sqrt(miu2)));
    sf = fa_mpeg_round((8. / 3.) * (log2(ratio)) + 2 * (log2(miu2)));
  } else {
    sf = 0;
  }
  return sf;
}


x86 assembly (clang, -O0):
<fa_estimate_sf_fast_improve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1213 <fa_estimate_sf_fast_improve+0xe3>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log2@plt>
movsd  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log2@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe18(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe04(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    $0x1,%al
call   1040 <fa_mpeg_round@plt>
mov    %eax,-0x14(%rbp)
jmp    121a <fa_estimate_sf_fast_improve+0xea>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_estimate_sf_fast_improve>:
movaps %xmm0,%xmm3
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jbe    115c <fa_estimate_sf_fast_improve+0x2c>
sub    $0x18,%rsp
cvtss2sd %xmm2,%xmm2
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm2
movsd  %xmm2,0x10(%rsp)
jb     115f <fa_estimate_sf_fast_improve+0x2f>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1188 <fa_estimate_sf_fast_improve+0x58>
xor    %eax,%eax
ret
movapd %xmm2,%xmm0
movss  %xmm1,(%rsp)
movss  %xmm3,0x8(%rsp)
call   1050 <sqrt@plt>
xorpd  %xmm4,%xmm4
movss  0x8(%rsp),%xmm3
movss  (%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
cvtss2sd %xmm3,%xmm3
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
ucomisd %xmm4,%xmm0
jb     11a0 <fa_estimate_sf_fast_improve+0x70>
sqrtsd %xmm0,%xmm0
jmp    11bb <fa_estimate_sf_fast_improve+0x8b>
movsd  %xmm3,(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1050 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm3
mulsd  %xmm1,%xmm0
divsd  %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log2@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <log2@plt>
addsd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
mulsd  0xe0c(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    $0x1,%al
add    $0x18,%rsp
jmp    1040 <fa_mpeg_round@plt>

LLVM IR (-O0):
define i32 @fa_estimate_sf_fast_improve(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %5
%10 = fcmp ogt float %9, 0.000000e+00
br i1 %10, label %11, label %35
11: ; preds = %3
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = load float, float* %5
%15 = fpext float %14 to double
%16 = load float, float* %6
%17 = fpext float %16 to double
%18 = load float, float* %6
%19 = fpext float %18 to double
%20 = call double @sqrt(double %19)
%21 = fmul double %17, %20
%22 = call double @sqrt(double %21)
%23 = fmul double %15, %22
%24 = fdiv double %13, %23
%25 = fptrunc double %24 to float
store float %25, float* %7
%26 = load float, float* %7
%27 = fpext float %26 to double
%28 = call double @log2(double %27)
%29 = load float, float* %6
%30 = fpext float %29 to double
%31 = call double @log2(double %30)
%32 = fmul double 2.000000e+00, %31
%33 = call double @llvm.fmuladd.f64(double 0x4005555555555555, double %28, double %32)
%34 = call i32 (double, ...) bitcast (i32 (...)* @fa_mpeg_round to i32 (double, ...)*)(double %33)
store i32 %34, i32* %8
br label %36
35: ; preds = %3
store i32 0, i32* %8
br label %36
36: ; preds = %35, %11
%37 = load i32, i32* %8
ret i32 %37
}

LLVM IR (-O2):
define i32 @fa_estimate_sf_fast_improve(float %0, float %1, float %2) {
%4 = fcmp ogt float %1, 0.000000e+00
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = fpext float %0 to double
%7 = fpext float %1 to double
%8 = fpext float %2 to double
%9 = tail call double @sqrt(double %8)
%10 = fmul double %9, %8
%11 = tail call double @sqrt(double %10)
%12 = fmul double %11, %7
%13 = fdiv double %6, %12
%14 = fptrunc double %13 to float
%15 = fpext float %14 to double
%16 = tail call double @log2(double %15)
%17 = tail call double @log2(double %8)
%18 = fmul double %17, 2.000000e+00
%19 = tail call double @llvm.fmuladd.f64(double %16, double 0x4005555555555555, double %18)
%20 = tail call i32 (double, ...) bitcast (i32 (...)* @fa_mpeg_round to i32 (double, ...)*)(double %19)
br label %21
21: ; preds = %3, %5
%22 = phi i32 [ %20, %5 ], [ 0, %3 ]
ret i32 %22
}