double amsp_interpolate_bessel(const double *vals, int from, double rt) {
  return -(1 / 6.) * rt *
             ((2 - rt * (3 - rt)) * vals[from - 1] +
              (1 - rt) * vals[from + 2]) +
         (1 / 2.) * ((2 + rt * (-1 + rt * (-2 + rt))) * vals[from] +
                     rt * (2 + rt * (1 - rt)) * vals[from + 1]);
}


x86 assembly (clang, -O0):
<amsp_interpolate_bessel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  0xf18(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xefe(%rip),%xmm1
subsd  -0x18(%rbp),%xmm1
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm1,%xmm2
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm2
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0xea0(%rip),%xmm1
subsd  -0x18(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm1
movsd  0xe7f(%rip),%xmm4
addsd  -0x18(%rbp),%xmm4
mulsd  %xmm4,%xmm1
movsd  0xe66(%rip),%xmm4
addsd  %xmm4,%xmm1
mulsd  %xmm1,%xmm3
movsd  0xe46(%rip),%xmm1
addsd  %xmm1,%xmm3
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm5
movsd  0xe2b(%rip),%xmm6
subsd  -0x18(%rbp),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xe12(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm4,%xmm3
addsd  %xmm1,%xmm3
movsd  0xde0(%rip),%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<amsp_interpolate_bessel>:
movsd  0xf00(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef8(%rip),%xmm2
movsd  0xef8(%rip),%xmm3
subsd  %xmm0,%xmm3
movapd %xmm0,%xmm4
mulsd  %xmm3,%xmm4
movsd  0xeec(%rip),%xmm5
addsd  %xmm0,%xmm5
mulsd  %xmm0,%xmm5
addsd  0xee4(%rip),%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm2,%xmm5
addsd  %xmm2,%xmm4
subsd  %xmm1,%xmm2
movsd  0xea4(%rip),%xmm1
movslq %esi,%rax
mulsd  0x10(%rdi,%rax,8),%xmm3
mulsd  -0x8(%rdi,%rax,8),%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm4,%xmm0
mulsd  0x8(%rdi,%rax,8),%xmm0
mulsd  (%rdi,%rax,8),%xmm5
addsd  %xmm5,%xmm0
mulsd  0xe9e(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @amsp_interpolate_bessel(double* %0, i32 %1, double %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fmul double 0xBFC5555555555555, %7
%9 = load double, double* %6
%10 = load double, double* %6
%11 = fsub double 3.000000e+00, %10
%12 = fneg double %9
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double 2.000000e+00)
%14 = load double*, double** %4
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %14, i64 %17
%19 = load double, double* %18
%20 = load double, double* %6
%21 = fsub double 1.000000e+00, %20
%22 = load double*, double** %4
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %22, i64 %25
%27 = load double, double* %26
%28 = fmul double %21, %27
%29 = call double @llvm.fmuladd.f64(double %13, double %19, double %28)
%30 = load double, double* %6
%31 = load double, double* %6
%32 = load double, double* %6
%33 = fadd double -2.000000e+00, %32
%34 = call double @llvm.fmuladd.f64(double %31, double %33, double -1.000000e+00)
%35 = call double @llvm.fmuladd.f64(double %30, double %34, double 2.000000e+00)
%36 = load double*, double** %4
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
%40 = load double, double* %39
%41 = load double, double* %6
%42 = load double, double* %6
%43 = load double, double* %6
%44 = fsub double 1.000000e+00, %43
%45 = call double @llvm.fmuladd.f64(double %42, double %44, double 2.000000e+00)
%46 = fmul double %41, %45
%47 = load double*, double** %4
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %47, i64 %50
%52 = load double, double* %51
%53 = fmul double %46, %52
%54 = call double @llvm.fmuladd.f64(double %35, double %40, double %53)
%55 = fmul double 5.000000e-01, %54
%56 = call double @llvm.fmuladd.f64(double %8, double %29, double %55)
ret double %56
}

LLVM IR (-O2):
define double @amsp_interpolate_bessel(double* nocapture %0, i32 %1, double %2) {
%4 = fmul double %2, 0xBFC5555555555555
%5 = fsub double 3.000000e+00, %2
%6 = fneg double %2
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double 2.000000e+00)
%8 = add nsw i32 %1, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
%12 = fsub double 1.000000e+00, %2
%13 = add nsw i32 %1, 2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %0, i64 %14
%16 = load double, double* %15
%17 = fmul double %12, %16
%18 = tail call double @llvm.fmuladd.f64(double %7, double %11, double %17)
%19 = fadd double %2, -2.000000e+00
%20 = tail call double @llvm.fmuladd.f64(double %2, double %19, double -1.000000e+00)
%21 = tail call double @llvm.fmuladd.f64(double %2, double %20, double 2.000000e+00)
%22 = sext i32 %1 to i64
%23 = getelementptr inbounds double, double* %0, i64 %22
%24 = load double, double* %23
%25 = tail call double @llvm.fmuladd.f64(double %2, double %12, double 2.000000e+00)
%26 = fmul double %25, %2
%27 = add nsw i32 %1, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %0, i64 %28
%30 = load double, double* %29
%31 = fmul double %26, %30
%32 = tail call double @llvm.fmuladd.f64(double %21, double %24, double %31)
%33 = fmul double %32, 5.000000e-01
%34 = tail call double @llvm.fmuladd.f64(double %4, double %18, double %33)
ret double %34
}