double sinapprox_d(double val) {
  double val2 = val * val;
  return val *
         (0.9999999945159759653 +
          val2 *
              (-0.1666666458182987439 +
               val2 *
                   (8.3333103922589284663e-3 +
                    val2 *
                        (-1.9840155355055654144e-4 +
                         val2 * (2.7529454331962521774e-6 +
                                 val2 * (-2.4676970823046321831e-8 +
                                         val2 * 1.3451481340051383601e-10))))));
}


x86 assembly (clang, -O0):
<sinapprox_d>:
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
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm5
movsd  -0x10(%rbp),%xmm6
movsd  0xee5(%rip),%xmm7
mulsd  %xmm7,%xmm6
movsd  0xee1(%rip),%xmm7
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm5
movsd  0xec1(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xea9(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe91(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe79(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe61(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @sinapprox_d(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* %2
%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 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %13, double 0x3DE27CD1BA1D81A3, double 0xBE5A7F277269C887)
%15 = call double @llvm.fmuladd.f64(double %12, double %14, double 0x3EC717E7C1D8E95F)
%16 = call double @llvm.fmuladd.f64(double %11, double %15, double 0xBF2A01405E320072)
%17 = call double @llvm.fmuladd.f64(double %10, double %16, double 0x3F81110DFCD13DFF)
%18 = call double @llvm.fmuladd.f64(double %9, double %17, double 0xBFC55555288FD265)
%19 = call double @llvm.fmuladd.f64(double %8, double %18, double 0x3FEFFFFFFD0E480F)
%20 = fmul double %7, %19
ret double %20
}

LLVM IR (-O2):
define double @sinapprox_d(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x3DE27CD1BA1D81A3, double 0xBE5A7F277269C887)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double 0x3EC717E7C1D8E95F)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 0xBF2A01405E320072)
%6 = tail call double @llvm.fmuladd.f64(double %2, double %5, double 0x3F81110DFCD13DFF)
%7 = tail call double @llvm.fmuladd.f64(double %2, double %6, double 0xBFC55555288FD265)
%8 = tail call double @llvm.fmuladd.f64(double %2, double %7, double 0x3FEFFFFFFD0E480F)
%9 = fmul double %8, %0
ret double %9
}