double hermite_interpolation(double x, double x0, double x1, double p0,
                             double p1, double m0, double m1) {
  double width = x1 - x0;
  double t = (x - x0) / width;
  double t2, t3;
  double ct0, ct1, ct2, ct3;
  m0 *= width;
  m1 *= width;
  t2 = t * t;
  t3 = t2 * t;
  ct0 = p0;
  ct1 = m0;
  ct2 = -3 * p0 - 2 * m0 + 3 * p1 - m1;
  ct3 = 2 * p0 + m0 - 2 * p1 + m1;
  return ct3 * t3 + ct2 * t2 + ct1 * t + ct0;
}


x86 assembly (clang, -O0):
<hermite_interpolation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xe69(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe3d(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xe20(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x60(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hermite_interpolation>:
subsd  %xmm1,%xmm2
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm5
mulsd  %xmm6,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm8
mulsd  %xmm1,%xmm8
movapd %xmm3,%xmm7
addsd  %xmm3,%xmm7
addsd  %xmm5,%xmm7
mulsd  %xmm5,%xmm0
addsd  %xmm5,%xmm5
movsd  0xebe(%rip),%xmm6
mulsd  %xmm3,%xmm6
subsd  %xmm5,%xmm6
movsd  0xeb6(%rip),%xmm5
mulsd  %xmm4,%xmm5
addsd  %xmm6,%xmm5
subsd  %xmm2,%xmm5
addsd  %xmm4,%xmm4
subsd  %xmm4,%xmm7
addsd  %xmm2,%xmm7
mulsd  %xmm8,%xmm7
mulsd  %xmm1,%xmm5
addsd  %xmm7,%xmm5
addsd  %xmm5,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @hermite_interpolation(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%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
%21 = alloca double
%22 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%23 = load double, double* %10
%24 = load double, double* %9
%25 = fsub double %23, %24
store double %25, double* %15
%26 = load double, double* %8
%27 = load double, double* %9
%28 = fsub double %26, %27
%29 = load double, double* %15
%30 = fdiv double %28, %29
store double %30, double* %16
%31 = load double, double* %15
%32 = load double, double* %13
%33 = fmul double %32, %31
store double %33, double* %13
%34 = load double, double* %15
%35 = load double, double* %14
%36 = fmul double %35, %34
store double %36, double* %14
%37 = load double, double* %16
%38 = load double, double* %16
%39 = fmul double %37, %38
store double %39, double* %17
%40 = load double, double* %17
%41 = load double, double* %16
%42 = fmul double %40, %41
store double %42, double* %18
%43 = load double, double* %11
store double %43, double* %19
%44 = load double, double* %13
store double %44, double* %20
%45 = load double, double* %11
%46 = load double, double* %13
%47 = fmul double 2.000000e+00, %46
%48 = fneg double %47
%49 = call double @llvm.fmuladd.f64(double -3.000000e+00, double %45, double %48)
%50 = load double, double* %12
%51 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %50, double %49)
%52 = load double, double* %14
%53 = fsub double %51, %52
store double %53, double* %21
%54 = load double, double* %11
%55 = load double, double* %13
%56 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %54, double %55)
%57 = load double, double* %12
%58 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %57, double %56)
%59 = load double, double* %14
%60 = fadd double %58, %59
store double %60, double* %22
%61 = load double, double* %22
%62 = load double, double* %18
%63 = load double, double* %21
%64 = load double, double* %17
%65 = fmul double %63, %64
%66 = call double @llvm.fmuladd.f64(double %61, double %62, double %65)
%67 = load double, double* %20
%68 = load double, double* %16
%69 = call double @llvm.fmuladd.f64(double %67, double %68, double %66)
%70 = load double, double* %19
%71 = fadd double %69, %70
ret double %71
}

LLVM IR (-O2):
define double @hermite_interpolation(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fsub double %2, %1
%9 = fsub double %0, %1
%10 = fdiv double %9, %8
%11 = fmul double %8, %5
%12 = fmul double %8, %6
%13 = fmul double %10, %10
%14 = fmul double %10, %13
%15 = fmul double %11, -2.000000e+00
%16 = tail call double @llvm.fmuladd.f64(double %3, double -3.000000e+00, double %15)
%17 = tail call double @llvm.fmuladd.f64(double %4, double 3.000000e+00, double %16)
%18 = fsub double %17, %12
%19 = tail call double @llvm.fmuladd.f64(double %3, double 2.000000e+00, double %11)
%20 = tail call double @llvm.fmuladd.f64(double %4, double -2.000000e+00, double %19)
%21 = fadd double %12, %20
%22 = fmul double %13, %18
%23 = tail call double @llvm.fmuladd.f64(double %21, double %14, double %22)
%24 = tail call double @llvm.fmuladd.f64(double %11, double %10, double %23)
%25 = fadd double %24, %3
ret double %25
}