double minimaxsin(double x) {
  while (x < 0.0)
    x += 6.283185307179586476925286766559005768394338798750210;
  while (x >= 6.283185307179586476925286766559005768394338798750210)
    x -= 6.283185307179586476925286766559005768394338798750210;
  double s = 1.0;
  if (x >= 3.141592653589793238462643383279502884197169399375105) {
    x -= 3.141592653589793238462643383279502884197169399375105;
    s = -1.0;
  }
  static const double a0 = 1.0, a1 = -1.666666666640169148537065260055e-1,
                      a2 = 8.333333316490113523036717102793e-3,
                      a3 = -1.984126600659171392655484413285e-4,
                      a4 = 2.755690114917374804474016589137e-6,
                      a5 = -2.502845227292692953118686710787e-8,
                      a6 = 1.538730635926417598443354215485e-10;
  double x2 = x * x;
  return s * x *
         (a0 +
          x2 * (a1 + x2 * (a2 + x2 * (a3 + x2 * (a4 + x2 * (a5 + x2 * a6))))));
}


x86 assembly (clang, -O0):
<minimaxsin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112e <minimaxsin+0x2e>
movsd  0xee1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1109 <minimaxsin+0x9>
jmp    1133 <minimaxsin+0x33>
movsd  -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1165 <minimaxsin+0x65>
movsd  -0x8(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1133 <minimaxsin+0x33>
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe89(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11ac <minimaxsin+0xac>
movsd  -0x8(%rbp),%xmm0
movsd  0xe72(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  -0x18(%rbp),%xmm6
movsd  0xe55(%rip),%xmm7
mulsd  %xmm7,%xmm6
movsd  0xe51(%rip),%xmm7
addsd  %xmm7,%xmm6
mulsd  %xmm6,%xmm5
movsd  0xe31(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xe19(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe01(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xde9(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xdc9(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimaxsin>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    112a <minimaxsin+0x2a>
movsd  0xeee(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     1120 <minimaxsin+0x20>
ucomisd 0xece(%rip),%xmm0
jb     115a <minimaxsin+0x5a>
movsd  0xecc(%rip),%xmm1
movsd  0xebc(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jae    1150 <minimaxsin+0x50>
movsd  0xeae(%rip),%xmm1
ucomisd %xmm1,%xmm0
movsd  0xeaa(%rip),%xmm2
addsd  %xmm0,%xmm2
cmpnlesd %xmm0,%xmm1
movapd %xmm1,%xmm3
andpd  %xmm0,%xmm3
andnpd %xmm2,%xmm1
orpd   %xmm3,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
jb     119d <minimaxsin+0x9d>
xorpd  0xec7(%rip),%xmm1
movapd %xmm1,%xmm0
movsd  0xe7b(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe77(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe73(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe6f(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe6b(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe67(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe63(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
@minimaxsin.a0 = internal constant double 1.000000e+00
@minimaxsin.a1 = internal constant double 0xBFC555555553E06A
@minimaxsin.a2 = internal constant double 0x3F811111107CE982
@minimaxsin.a3 = internal constant double 0xBF2A019FC5AE4E82
@minimaxsin.a4 = internal constant double 0x3EC71DCCA975860A
@minimaxsin.a5 = internal constant double 0xBE5ADFC4C151EF2E
@minimaxsin.a6 = internal constant double 0x3DE525ED57FDCB8D
define double @minimaxsin(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
br label %5
5: ; preds = %8, %1
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load double, double* %2
%10 = fadd double %9, 0x401921FB54442D18
store double %10, double* %2
br label %5
11: ; preds = %5
br label %12
12: ; preds = %15, %11
%13 = load double, double* %2
%14 = fcmp oge double %13, 0x401921FB54442D18
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load double, double* %2
%17 = fsub double %16, 0x401921FB54442D18
store double %17, double* %2
br label %12
18: ; preds = %12
store double 1.000000e+00, double* %3
%19 = load double, double* %2
%20 = fcmp oge double %19, 0x400921FB54442D18
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load double, double* %2
%23 = fsub double %22, 0x400921FB54442D18
store double %23, double* %2
store double -1.000000e+00, double* %3
br label %24
24: ; preds = %21, %18
%25 = load double, double* %2
%26 = load double, double* %2
%27 = fmul double %25, %26
store double %27, double* %4
%28 = load double, double* %3
%29 = load double, double* %2
%30 = fmul double %28, %29
%31 = load double, double* %4
%32 = load double, double* %4
%33 = load double, double* %4
%34 = load double, double* %4
%35 = load double, double* %4
%36 = load double, double* %4
%37 = call double @llvm.fmuladd.f64(double %36, double 0x3DE525ED57FDCB8D, double 0xBE5ADFC4C151EF2E)
%38 = call double @llvm.fmuladd.f64(double %35, double %37, double 0x3EC71DCCA975860A)
%39 = call double @llvm.fmuladd.f64(double %34, double %38, double 0xBF2A019FC5AE4E82)
%40 = call double @llvm.fmuladd.f64(double %33, double %39, double 0x3F811111107CE982)
%41 = call double @llvm.fmuladd.f64(double %32, double %40, double 0xBFC555555553E06A)
%42 = call double @llvm.fmuladd.f64(double %31, double %41, double 1.000000e+00)
%43 = fmul double %30, %42
ret double %43
}

LLVM IR (-O2):
define double @minimaxsin(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi double [ %0, %1 ], [ %8, %6 ]
%5 = fcmp ult double %4, 0x401921FB54442D18
br i1 %5, label %14, label %10
6: ; preds = %1, %6
%7 = phi double [ %8, %6 ], [ %0, %1 ]
%8 = fadd double %7, 0x401921FB54442D18
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %6, label %3
10: ; preds = %3, %10
%11 = phi double [ %12, %10 ], [ %4, %3 ]
%12 = fadd double %11, 0xC01921FB54442D18
%13 = fcmp ult double %12, 0x401921FB54442D18
br i1 %13, label %14, label %10
14: ; preds = %10, %3
%15 = phi double [ %4, %3 ], [ %12, %10 ]
%16 = fcmp ult double %15, 0x400921FB54442D18
%17 = fadd double %15, 0xC00921FB54442D18
%18 = select i1 %16, double %15, double %17
%19 = fmul double %18, %18
%20 = fneg double %18
%21 = select i1 %16, double %15, double %20
%22 = tail call double @llvm.fmuladd.f64(double %19, double 0x3DE525ED57FDCB8D, double 0xBE5ADFC4C151EF2E)
%23 = tail call double @llvm.fmuladd.f64(double %19, double %22, double 0x3EC71DCCA975860A)
%24 = tail call double @llvm.fmuladd.f64(double %19, double %23, double 0xBF2A019FC5AE4E82)
%25 = tail call double @llvm.fmuladd.f64(double %19, double %24, double 0x3F811111107CE982)
%26 = tail call double @llvm.fmuladd.f64(double %19, double %25, double 0xBFC555555553E06A)
%27 = tail call double @llvm.fmuladd.f64(double %19, double %26, double 1.000000e+00)
%28 = fmul double %21, %27
ret double %28
}