double cos_121s(double x) {
  static const double c1 = 0.99999999999925182;
  static const double c2 = -0.49999999997024012;
  static const double c3 = 0.041666666473384543;
  static const double c4 = -0.001388888418000423;
  static const double c5 = 0.0000248010406484558;
  static const double c6 = -0.0000002752469638432;
  static const double c7 = 0.0000000019907856854;
  double x2;
  x2 = x * x;
  return (c1 +
          x2 * (c2 + x2 * (c3 + x2 * (c4 + x2 * (c5 + x2 * (c6 + c7 * x2))))));
}


x86 assembly (clang, -O0):
<cos_121s>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm5
movsd  0xeea(%rip),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xee6(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xec6(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xeae(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe96(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe7e(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe66(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_121s>:
mulsd  %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee0(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xedc(%rip),%xmm0
ret

LLVM IR (-O0):
@cos_121s.c1 = internal constant double 0x3FEFFFFFFFFFE5AD
@cos_121s.c2 = internal constant double 0xBFDFFFFFFFF7D1D6
@cos_121s.c3 = internal constant double 0x3FA5555553AC4D2C
@cos_121s.c4 = internal constant double 0xBF56C16B9551979C
@cos_121s.c5 = internal constant double 0x3EFA017A892EC93C
@cos_121s.c6 = internal constant double 0xBE9278B4F2F32463
@cos_121s.c7 = internal constant double 0x3E2119C8B5785B45
define double @cos_121s(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = load double, double* %3
%10 = load double, double* %3
%11 = load double, double* %3
%12 = load double, double* %3
%13 = call double @llvm.fmuladd.f64(double 0x3E2119C8B5785B45, double %12, double 0xBE9278B4F2F32463)
%14 = call double @llvm.fmuladd.f64(double %11, double %13, double 0x3EFA017A892EC93C)
%15 = call double @llvm.fmuladd.f64(double %10, double %14, double 0xBF56C16B9551979C)
%16 = call double @llvm.fmuladd.f64(double %9, double %15, double 0x3FA5555553AC4D2C)
%17 = call double @llvm.fmuladd.f64(double %8, double %16, double 0xBFDFFFFFFFF7D1D6)
%18 = call double @llvm.fmuladd.f64(double %7, double %17, double 0x3FEFFFFFFFFFE5AD)
ret double %18
}

LLVM IR (-O2):
define double @cos_121s(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x3E2119C8B5785B45, double 0xBE9278B4F2F32463)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double 0x3EFA017A892EC93C)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 0xBF56C16B9551979C)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %5, double 0x3FA5555553AC4D2C)
%7 = tail call double @llvm.fmuladd.f64(double %2, double %6, double 0xBFDFFFFFFFF7D1D6)
%8 = tail call double @llvm.fmuladd.f64(double %2, double %7, double 0x3FEFFFFFFFFFE5AD)
ret double %8
}