double Mitchell_filter(double t) {
  double t2 = t * t;
  if (t < 0)
    t = -t;
  if (t < 1)
    return ((12 - 9 * (1.0 / 3.0) - 6 * (1.0 / 3.0)) * (t * t2) +
            (-18 + 12 * (1.0 / 3.0) + 6 * (1.0 / 3.0)) * t2 +
            (6 - 2 * (1.0 / 3.0))) /
           6;
  else if (t < 2)
    return ((-1 * (1.0 / 3.0) - 6 * (1.0 / 3.0)) * (t * t2) +
            (6 * (1.0 / 3.0) + 30 * (1.0 / 3.0)) * t2 +
            (-12 * (1.0 / 3.0) - 48 * (1.0 / 3.0)) * t +
            (8 * (1.0 / 3.0) + 24 * (1.0 / 3.0))) /
           6;
  else
    return 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    11a3 <Mitchell_filter+0xa3>
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  0xe7b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    121c <Mitchell_filter+0x11c>
movsd  0xe5d(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1214 <Mitchell_filter+0x114>
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xe68(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe53(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe36(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe1e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe0a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    121c <Mitchell_filter+0x11c>
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 %25
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
%24 = fdiv double %23, 6.000000e+00
store double %24, double* %2
br label %40
25: ; preds = %13
%26 = load double, double* %3
%27 = fcmp olt double %26, 2.000000e+00
br i1 %27, label %28, label %39
28: ; preds = %25
%29 = load double, double* %3
%30 = load double, double* %4
%31 = fmul double %29, %30
%32 = load double, double* %4
%33 = fmul double 1.200000e+01, %32
%34 = call double @llvm.fmuladd.f64(double 0xC002AAAAAAAAAAAB, double %31, double %33)
%35 = load double, double* %3
%36 = call double @llvm.fmuladd.f64(double -2.000000e+01, double %35, double %34)
%37 = fadd double %36, 0x4025555555555555
%38 = fdiv double %37, 6.000000e+00
store double %38, double* %2
br label %40
39: ; preds = %25
store double 0.000000e+00, double* %2
br label %40
40: ; preds = %39, %28, %16
%41 = load double, double* %2
ret double %41
}

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
}