double sin_taylor5(const double x) {
  const double x2 = x * x;
  const double x3 = x * x2;
  const double x5 = x3 * x2;
  const double x7 = x5 * x2;
  const double x9 = x7 * x2;
  return x - x3 * (1.0 / 6) + x5 * (1.0 / 120) - x7 * (1.0 / 5040) +
         x9 * (1.0 / 362880);
}


x86 assembly (clang, -O0):
<sin_taylor5>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe9b(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe4a(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  0xe2d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_taylor5>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm1,%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm1
mulsd  0xed4(%rip),%xmm2
mulsd  0xed4(%rip),%xmm3
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
mulsd  0xecc(%rip),%xmm4
addsd  %xmm4,%xmm0
mulsd  0xec8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sin_taylor5(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = load double, double* %2
%9 = load double, double* %2
%10 = fmul double %8, %9
store double %10, double* %3
%11 = load double, double* %2
%12 = load double, double* %3
%13 = fmul double %11, %12
store double %13, double* %4
%14 = load double, double* %4
%15 = load double, double* %3
%16 = fmul double %14, %15
store double %16, double* %5
%17 = load double, double* %5
%18 = load double, double* %3
%19 = fmul double %17, %18
store double %19, double* %6
%20 = load double, double* %6
%21 = load double, double* %3
%22 = fmul double %20, %21
store double %22, double* %7
%23 = load double, double* %2
%24 = load double, double* %4
%25 = fneg double %24
%26 = call double @llvm.fmuladd.f64(double %25, double 0x3FC5555555555555, double %23)
%27 = load double, double* %5
%28 = call double @llvm.fmuladd.f64(double %27, double 0x3F81111111111111, double %26)
%29 = load double, double* %6
%30 = fneg double %29
%31 = call double @llvm.fmuladd.f64(double %30, double 0x3F2A01A01A01A01A, double %28)
%32 = load double, double* %7
%33 = call double @llvm.fmuladd.f64(double %32, double 0x3EC71DE3A556C734, double %31)
ret double %33
}

LLVM IR (-O2):
define double @sin_taylor5(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %2, %3
%5 = fmul double %2, %4
%6 = fmul double %2, %5
%7 = fneg double %3
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3FC5555555555555, double %0)
%9 = tail call double @llvm.fmuladd.f64(double %4, double 0x3F81111111111111, double %8)
%10 = fneg double %5
%11 = tail call double @llvm.fmuladd.f64(double %10, double 0x3F2A01A01A01A01A, double %9)
%12 = tail call double @llvm.fmuladd.f64(double %6, double 0x3EC71DE3A556C734, double %11)
ret double %12
}