double drag_cd_g7(double mach) {
  if (mach > 1.9)
    return 0.439493 + mach * (-0.0793543 + mach * 0.00448477);
  else if (mach > 1.05)
    return 0.642743 + mach * (-0.2725450 + mach * 0.049247500);
  else if (mach > 0.90)
    return -1.69655 + mach * 2.03557;
  else if (mach >= 0.60)
    return 0.353384 + mach * (-0.69240600 + mach * 0.50946900);
  else
    return 0.119775 + mach * (-0.00231118 + mach * 0.00286712);
}


x86 assembly (clang, -O0):
<drag_cd_g7>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115c <drag_cd_g7+0x5c>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xf4e(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xf4a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xf2a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1277 <drag_cd_g7+0x177>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11af <drag_cd_g7+0xaf>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee3(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xedf(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1277 <drag_cd_g7+0x177>
movsd  -0x10(%rbp),%xmm0
movsd  0xe54(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11ed <drag_cd_g7+0xed>
movsd  -0x10(%rbp),%xmm0
movsd  0xe7d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1277 <drag_cd_g7+0x177>
movsd  -0x10(%rbp),%xmm0
movsd  0xe1e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1240 <drag_cd_g7+0x140>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe2a(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe26(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe06(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1277 <drag_cd_g7+0x177>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xdd6(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xdd2(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdb2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drag_cd_g7>:
ucomisd 0xef8(%rip),%xmm0
jbe    112f <drag_cd_g7+0x2f>
movsd  0xf66(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf62(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf5e(%rip),%xmm1
movapd %xmm1,%xmm0
ret
ucomisd 0xed1(%rip),%xmm0
jbe    115e <drag_cd_g7+0x5e>
movsd  0xf1f(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf1b(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf17(%rip),%xmm1
movapd %xmm1,%xmm0
ret
ucomisd 0xeaa(%rip),%xmm0
jbe    1179 <drag_cd_g7+0x79>
mulsd  0xee0(%rip),%xmm0
addsd  0xee0(%rip),%xmm0
ret
ucomisd 0xe97(%rip),%xmm0
jae    11a8 <drag_cd_g7+0xa8>
movsd  0xead(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xea9(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xea5(%rip),%xmm1
movapd %xmm1,%xmm0
ret
movsd  0xe70(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe6c(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe68(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @drag_cd_g7(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 1.900000e+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 4.484770e-03, double -7.935430e-02)
%10 = call double @llvm.fmuladd.f64(double %7, double %9, double 4.394930e-01)
store double %10, double* %2
br label %38
11: ; preds = %1
%12 = load double, double* %3
%13 = fcmp ogt double %12, 1.050000e+00
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load double, double* %3
%16 = load double, double* %3
%17 = call double @llvm.fmuladd.f64(double %16, double 4.924750e-02, double -2.725450e-01)
%18 = call double @llvm.fmuladd.f64(double %15, double %17, double 6.427430e-01)
store double %18, double* %2
br label %38
19: ; preds = %11
%20 = load double, double* %3
%21 = fcmp ogt double %20, 9.000000e-01
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load double, double* %3
%24 = call double @llvm.fmuladd.f64(double %23, double 2.035570e+00, double -1.696550e+00)
store double %24, double* %2
br label %38
25: ; preds = %19
%26 = load double, double* %3
%27 = fcmp oge double %26, 6.000000e-01
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load double, double* %3
%30 = load double, double* %3
%31 = call double @llvm.fmuladd.f64(double %30, double 5.094690e-01, double -6.924060e-01)
%32 = call double @llvm.fmuladd.f64(double %29, double %31, double 3.533840e-01)
store double %32, double* %2
br label %38
33: ; preds = %25
%34 = load double, double* %3
%35 = load double, double* %3
%36 = call double @llvm.fmuladd.f64(double %35, double 2.867120e-03, double -2.311180e-03)
%37 = call double @llvm.fmuladd.f64(double %34, double %36, double 1.197750e-01)
store double %37, double* %2
br label %38
38: ; preds = %33, %28, %22, %14, %6
%39 = load double, double* %2
ret double %39
}

LLVM IR (-O2):
define double @drag_cd_g7(double %0) {
%2 = fcmp ogt double %0, 1.900000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double 4.484770e-03, double -7.935430e-02)
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double 4.394930e-01)
br label %23
6: ; preds = %1
%7 = fcmp ogt double %0, 1.050000e+00
br i1 %7, label %8, label %11
8: ; preds = %6
%9 = tail call double @llvm.fmuladd.f64(double %0, double 4.924750e-02, double -2.725450e-01)
%10 = tail call double @llvm.fmuladd.f64(double %0, double %9, double 6.427430e-01)
br label %23
11: ; preds = %6
%12 = fcmp ogt double %0, 9.000000e-01
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = tail call double @llvm.fmuladd.f64(double %0, double 2.035570e+00, double -1.696550e+00)
br label %23
15: ; preds = %11
%16 = fcmp ult double %0, 6.000000e-01
br i1 %16, label %20, label %17
17: ; preds = %15
%18 = tail call double @llvm.fmuladd.f64(double %0, double 5.094690e-01, double -6.924060e-01)
%19 = tail call double @llvm.fmuladd.f64(double %0, double %18, double 3.533840e-01)
br label %23
20: ; preds = %15
%21 = tail call double @llvm.fmuladd.f64(double %0, double 2.867120e-03, double -2.311180e-03)
%22 = tail call double @llvm.fmuladd.f64(double %0, double %21, double 1.197750e-01)
br label %23
23: ; preds = %20, %17, %13, %8, %3
%24 = phi double [ %5, %3 ], [ %10, %8 ], [ %14, %13 ], [ %19, %17 ], [ %22, %20 ]
ret double %24
}