double drag_cd_g8(double mach) {
  if (mach > 1.1)
    return 0.639096 + mach * (-0.197471 + mach * 0.0216221);
  else if (mach >= 0.925)
    return -12.9053 + mach * (24.9181 - mach * 11.6191);
  else
    return 0.210589 + mach * (-0.00184895 + mach * 0.00211107);
}


x86 assembly (clang, -O0):
<drag_cd_g8>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115c <drag_cd_g8+0x5c>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xf16(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xf12(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xef2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11fd <drag_cd_g8+0xfd>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11c6 <drag_cd_g8+0xc6>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe94(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe90(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe70(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11fd <drag_cd_g8+0xfd>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe40(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe3c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drag_cd_g8>:
ucomisd 0xef8(%rip),%xmm0
jbe    112f <drag_cd_g8+0x2f>
movsd  0xf2e(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf2a(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf26(%rip),%xmm1
movapd %xmm1,%xmm0
ret
ucomisd 0xed1(%rip),%xmm0
jae    115e <drag_cd_g8+0x5e>
movsd  0xee7(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee3(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xedf(%rip),%xmm1
movapd %xmm1,%xmm0
ret
movsd  0xeaa(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xea6(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xea2(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @drag_cd_g8(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 1.100000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double %8, double 2.162210e-02, double -1.974710e-01)
%10 = call double @llvm.fmuladd.f64(double %7, double %9, double 6.390960e-01)
store double %10, double* %2
br label %25
11: ; preds = %1
%12 = load double, double* %3
%13 = fcmp oge double %12, 9.250000e-01
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load double, double* %3
%16 = load double, double* %3
%17 = fneg double %16
%18 = call double @llvm.fmuladd.f64(double %17, double 1.161910e+01, double 2.491810e+01)
%19 = call double @llvm.fmuladd.f64(double %15, double %18, double -1.290530e+01)
store double %19, double* %2
br label %25
20: ; preds = %11
%21 = load double, double* %3
%22 = load double, double* %3
%23 = call double @llvm.fmuladd.f64(double %22, double 2.111070e-03, double -1.848950e-03)
%24 = call double @llvm.fmuladd.f64(double %21, double %23, double 2.105890e-01)
store double %24, double* %2
br label %25
25: ; preds = %20, %14, %6
%26 = load double, double* %2
ret double %26
}

LLVM IR (-O2):
define double @drag_cd_g8(double %0) {
%2 = fcmp ogt double %0, 1.100000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double 2.162210e-02, double -1.974710e-01)
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double 6.390960e-01)
br label %15
6: ; preds = %1
%7 = fcmp ult double %0, 9.250000e-01
br i1 %7, label %12, label %8
8: ; preds = %6
%9 = fneg double %0
%10 = tail call double @llvm.fmuladd.f64(double %9, double 1.161910e+01, double 2.491810e+01)
%11 = tail call double @llvm.fmuladd.f64(double %0, double %10, double -1.290530e+01)
br label %15
12: ; preds = %6
%13 = tail call double @llvm.fmuladd.f64(double %0, double 2.111070e-03, double -1.848950e-03)
%14 = tail call double @llvm.fmuladd.f64(double %0, double %13, double 2.105890e-01)
br label %15
15: ; preds = %12, %8, %3
%16 = phi double [ %5, %3 ], [ %11, %8 ], [ %14, %12 ]
ret double %16
}