double pumas_electronic_dcs(double Z, double I, double m, double K, double q) {
  const double P2 = K * (K + 2. * m);
  const double E = K + m;
  const double Wmax = 2. * 0.510998910E-03 * P2 /
                      (m * m + 0.510998910E-03 * (0.510998910E-03 + 2. * E));
  if (q > Wmax)
    return 0.;
  const double Wmin = (13.6 / 19.2) * I;
  if (q <= Wmin)
    return 0.;
  const double E2 = E * E;
  const double beta2 = P2 / E2;
  const double a0 = 0.5 / E2;
  const double a1 = beta2 / Wmax;
  const double cs = 2 * 3.14159265358979323846 * 0.510998910E-03 *
                    2.817940285E-15 * 2.817940285E-15 * Z *
                    (a0 + 1. / q * (1 / q - a1)) / beta2;
  return cs;
}


x86 assembly (clang, -O0):
<pumas_electronic_dcs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeb4(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm4
addsd  %xmm4,%xmm4
movsd  0xe8c(%rip),%xmm2
addsd  %xmm2,%xmm4
movsd  0xe80(%rip),%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    11b2 <pumas_electronic_dcs+0xb2>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1275 <pumas_electronic_dcs+0x175>
movsd  0xe56(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11e5 <pumas_electronic_dcs+0xe5>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1275 <pumas_electronic_dcs+0x175>
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe1d(%rip),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xdf4(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  0xdda(%rip),%xmm1
divsd  -0x30(%rbp),%xmm1
movsd  0xdcd(%rip),%xmm3
divsd  -0x30(%rbp),%xmm3
subsd  -0x70(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pumas_electronic_dcs>:
mulsd  0xf08(%rip),%xmm1
ucomisd %xmm4,%xmm1
xorpd  %xmm1,%xmm1
jae    11b3 <pumas_electronic_dcs+0xb3>
movapd %xmm2,%xmm5
addsd  %xmm2,%xmm5
addsd  %xmm3,%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm2,%xmm3
movsd  0xece(%rip),%xmm6
mulsd  %xmm5,%xmm6
movapd %xmm3,%xmm7
addsd  %xmm3,%xmm7
movsd  0xec1(%rip),%xmm8
addsd  %xmm8,%xmm7
mulsd  %xmm8,%xmm7
mulsd  %xmm2,%xmm2
addsd  %xmm7,%xmm2
divsd  %xmm2,%xmm6
ucomisd %xmm6,%xmm4
ja     11b3 <pumas_electronic_dcs+0xb3>
mulsd  %xmm3,%xmm3
divsd  %xmm3,%xmm5
movsd  0xea5(%rip),%xmm2
divsd  %xmm3,%xmm2
mulsd  0xea1(%rip),%xmm0
movapd 0xea9(%rip),%xmm3
unpcklpd %xmm5,%xmm3
unpcklpd %xmm6,%xmm4
divpd  %xmm4,%xmm3
movapd %xmm3,%xmm4
unpckhpd %xmm3,%xmm4
movapd %xmm3,%xmm1
subsd  %xmm4,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
divsd  %xmm5,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pumas_electronic_dcs(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
%21 = load double, double* %10
%22 = load double, double* %10
%23 = load double, double* %9
%24 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %23, double %22)
%25 = fmul double %21, %24
store double %25, double* %12
%26 = load double, double* %10
%27 = load double, double* %9
%28 = fadd double %26, %27
store double %28, double* %13
%29 = load double, double* %12
%30 = fmul double 0x3F50BE91CDA9B5D6, %29
%31 = load double, double* %9
%32 = load double, double* %9
%33 = load double, double* %13
%34 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %33, double 0x3F40BE91CDA9B5D6)
%35 = fmul double 0x3F40BE91CDA9B5D6, %34
%36 = call double @llvm.fmuladd.f64(double %31, double %32, double %35)
%37 = fdiv double %30, %36
store double %37, double* %14
%38 = load double, double* %11
%39 = load double, double* %14
%40 = fcmp ogt double %38, %39
br i1 %40, label %41, label %42
41: ; preds = %5
store double 0.000000e+00, double* %6
br label %75
42: ; preds = %5
%43 = load double, double* %8
%44 = fmul double 0x3FE6AAAAAAAAAAAB, %43
store double %44, double* %15
%45 = load double, double* %11
%46 = load double, double* %15
%47 = fcmp ole double %45, %46
br i1 %47, label %48, label %49
48: ; preds = %42
store double 0.000000e+00, double* %6
br label %75
49: ; preds = %42
%50 = load double, double* %13
%51 = load double, double* %13
%52 = fmul double %50, %51
store double %52, double* %16
%53 = load double, double* %12
%54 = load double, double* %16
%55 = fdiv double %53, %54
store double %55, double* %17
%56 = load double, double* %16
%57 = fdiv double 5.000000e-01, %56
store double %57, double* %18
%58 = load double, double* %17
%59 = load double, double* %14
%60 = fdiv double %58, %59
store double %60, double* %19
%61 = load double, double* %7
%62 = fmul double 0x39608C2A561AEFCE, %61
%63 = load double, double* %18
%64 = load double, double* %11
%65 = fdiv double 1.000000e+00, %64
%66 = load double, double* %11
%67 = fdiv double 1.000000e+00, %66
%68 = load double, double* %19
%69 = fsub double %67, %68
%70 = call double @llvm.fmuladd.f64(double %65, double %69, double %63)
%71 = fmul double %62, %70
%72 = load double, double* %17
%73 = fdiv double %71, %72
store double %73, double* %20
%74 = load double, double* %20
store double %74, double* %6
br label %75
75: ; preds = %49, %48, %41
%76 = load double, double* %6
ret double %76
}

LLVM IR (-O2):
define double @pumas_electronic_dcs(double %0, double %1, double %2, double %3, double %4) {
%6 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+00, double %3)
%7 = fmul double %6, %3
%8 = fadd double %2, %3
%9 = fmul double %7, 0x3F50BE91CDA9B5D6
%10 = tail call double @llvm.fmuladd.f64(double %8, double 2.000000e+00, double 0x3F40BE91CDA9B5D6)
%11 = fmul double %10, 0x3F40BE91CDA9B5D6
%12 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %11)
%13 = fdiv double %9, %12
%14 = fcmp uge double %13, %4
%15 = fmul double %1, 0x3FE6AAAAAAAAAAAB
%16 = fcmp ult double %15, %4
%17 = and i1 %16, %14
br i1 %17, label %18, label %34
18: ; preds = %5
%19 = fmul double %8, %8
%20 = fdiv double %7, %19
%21 = fdiv double 5.000000e-01, %19
%22 = fmul double %0, 0x39608C2A561AEFCE
%23 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %20, i64 1
%24 = insertelement <2 x double> poison, double %4, i64 0
%25 = insertelement <2 x double> %24, double %13, i64 1
%26 = fdiv <2 x double> %23, %25
%27 = extractelement <2 x double> %26, i64 0
%28 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%29 = fsub <2 x double> %26, %28
%30 = extractelement <2 x double> %29, i64 0
%31 = tail call double @llvm.fmuladd.f64(double %27, double %30, double %21)
%32 = fmul double %22, %31
%33 = fdiv double %32, %20
br label %34
34: ; preds = %18, %5
%35 = phi double [ 0.000000e+00, %5 ], [ %33, %18 ]
ret double %35
}