double Mitchell_filter(double t) {
  double tt;
  tt = t * t;
  if (t < 0)
    t = -t;
  if (t < 1.0) {
    t = (((12.0 - 9.0 * (1.0 / 3.0) - 6.0 * (1.0 / 3.0)) * (t * tt)) +
         ((-18.0 + 12.0 * (1.0 / 3.0) + 6.0 * (1.0 / 3.0)) * tt) +
         (6.0 - 2 * (1.0 / 3.0)));
    return (t / 6.0);
  } else if (t < 2.0) {
    t = (((-1.0 * (1.0 / 3.0) - 6.0 * (1.0 / 3.0)) * (t * tt)) +
         ((6.0 * (1.0 / 3.0) + 30.0 * (1.0 / 3.0)) * tt) +
         ((-12.0 * (1.0 / 3.0) - 48.0 * (1.0 / 3.0)) * t) +
         (8.0 * (1.0 / 3.0) + 24 * (1.0 / 3.0)));
    return (t / 6.0);
  }
  return (0.0);
}


x86 assembly (clang, -O0):
<Mitchell_filter>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1147 <Mitchell_filter+0x47>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb1(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11ad <Mitchell_filter+0xad>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe71(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1235 <Mitchell_filter+0x135>
movsd  0xe53(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1228 <Mitchell_filter+0x128>
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xe5e(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe49(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe2c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe14(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xdf6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1235 <Mitchell_filter+0x135>
jmp    122d <Mitchell_filter+0x12d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mitchell_filter>:
movapd %xmm0,%xmm1
movapd 0xef4(%rip),%xmm3
xorpd  %xmm0,%xmm3
xorpd  %xmm0,%xmm0
movapd %xmm1,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm3
andnpd %xmm1,%xmm2
mulsd  %xmm1,%xmm1
orpd   %xmm3,%xmm2
movsd  0xedb(%rip),%xmm3
ucomisd %xmm2,%xmm3
jbe    1161 <Mitchell_filter+0x61>
movapd %xmm1,%xmm0
mulsd  0xf01(%rip),%xmm1
mulsd  %xmm2,%xmm0
mulsd  0xefd(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xef9(%rip),%xmm0
jmp    11a3 <Mitchell_filter+0xa3>
movsd  0xeaf(%rip),%xmm3
ucomisd %xmm2,%xmm3
jbe    11ab <Mitchell_filter+0xab>
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
mulsd  0xea1(%rip),%xmm1
mulsd  0xea1(%rip),%xmm3
addsd  %xmm1,%xmm3
movsd  0xe9d(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  0xe95(%rip),%xmm0
divsd  0xe95(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Mitchell_filter(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fmul double %5, %6
store double %7, double* %4
%8 = load double, double* %3
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %3
%12 = fneg double %11
store double %12, double* %3
br label %13
13: ; preds = %10, %1
%14 = load double, double* %3
%15 = fcmp olt double %14, 1.000000e+00
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load double, double* %3
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = load double, double* %4
%21 = fmul double -1.200000e+01, %20
%22 = call double @llvm.fmuladd.f64(double 7.000000e+00, double %19, double %21)
%23 = fadd double %22, 0x4015555555555555
store double %23, double* %3
%24 = load double, double* %3
%25 = fdiv double %24, 6.000000e+00
store double %25, double* %2
br label %43
26: ; preds = %13
%27 = load double, double* %3
%28 = fcmp olt double %27, 2.000000e+00
br i1 %28, label %29, label %41
29: ; preds = %26
%30 = load double, double* %3
%31 = load double, double* %4
%32 = fmul double %30, %31
%33 = load double, double* %4
%34 = fmul double 1.200000e+01, %33
%35 = call double @llvm.fmuladd.f64(double 0xC002AAAAAAAAAAAB, double %32, double %34)
%36 = load double, double* %3
%37 = call double @llvm.fmuladd.f64(double -2.000000e+01, double %36, double %35)
%38 = fadd double %37, 0x4025555555555555
store double %38, double* %3
%39 = load double, double* %3
%40 = fdiv double %39, 6.000000e+00
store double %40, double* %2
br label %43
41: ; preds = %26
br label %42
42: ; preds = %41
store double 0.000000e+00, double* %2
br label %43
43: ; preds = %42, %29, %16
%44 = load double, double* %2
ret double %44
}

LLVM IR (-O2):
define double @Mitchell_filter(double %0) {
%2 = fmul double %0, %0
%3 = fcmp olt double %0, 0.000000e+00
%4 = fneg double %0
%5 = select i1 %3, double %4, double %0
%6 = fcmp olt double %5, 1.000000e+00
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = fmul double %2, %5
%9 = fmul double %2, -1.200000e+01
%10 = tail call double @llvm.fmuladd.f64(double %8, double 7.000000e+00, double %9)
%11 = fadd double %10, 0x4015555555555555
%12 = fdiv double %11, 6.000000e+00
br label %22
13: ; preds = %1
%14 = fcmp olt double %5, 2.000000e+00
br i1 %14, label %15, label %22
15: ; preds = %13
%16 = fmul double %2, %5
%17 = fmul double %2, 1.200000e+01
%18 = tail call double @llvm.fmuladd.f64(double %16, double 0xC002AAAAAAAAAAAB, double %17)
%19 = tail call double @llvm.fmuladd.f64(double %5, double -2.000000e+01, double %18)
%20 = fadd double %19, 0x4025555555555555
%21 = fdiv double %20, 6.000000e+00
br label %22
22: ; preds = %13, %15, %7
%23 = phi double [ %12, %7 ], [ %21, %15 ], [ 0.000000e+00, %13 ]
ret double %23
}