double rational_approx(double t) {
  double c[] = {2.515517, 0.802853, 0.010328};
  double d[] = {1.432788, 0.189269, 0.001308};
  return t - ((c[2] * t + c[1]) * t + c[0]) /
                 (((d[2] * t + d[1]) * t + d[0]) * t + 1.0);
}


x86 assembly (clang, -O0):
<rational_approx>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0xf00(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xefd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xefa(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeff(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xefc(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xef9(%rip),%rax
mov    %rax,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x8(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
movsd  -0x8(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe4d(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rational_approx>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef4(%rip),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm1,%xmm2
movapd 0xeec(%rip),%xmm1
unpcklpd %xmm0,%xmm1
mulpd  %xmm2,%xmm1
addpd  0xeec(%rip),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
addpd  0xee8(%rip),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
divsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
@__const.rational_approx.c = [3 x double] [double 0x40041FC7607C419A, double 8.028530e-01, double 1.032800e-02]
@__const.rational_approx.d = [3 x double] [double 0x3FF6ECB31C219EB6, double 1.892690e-01, double 1.308000e-03]
define double @rational_approx(double %0) {
%2 = alloca double
%3 = alloca [3 x double]
%4 = alloca [3 x double]
store double %0, double* %2
%5 = bitcast [3 x double]* %3 to i8*
%6 = bitcast [3 x double]* %4 to i8*
%7 = load double, double* %2
%8 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%9 = load double, double* %8
%10 = load double, double* %2
%11 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%12 = load double, double* %11
%13 = call double @llvm.fmuladd.f64(double %9, double %10, double %12)
%14 = load double, double* %2
%15 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%16 = load double, double* %15
%17 = call double @llvm.fmuladd.f64(double %13, double %14, double %16)
%18 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 2
%19 = load double, double* %18
%20 = load double, double* %2
%21 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 1
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %20, double %22)
%24 = load double, double* %2
%25 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%26 = load double, double* %25
%27 = call double @llvm.fmuladd.f64(double %23, double %24, double %26)
%28 = load double, double* %2
%29 = call double @llvm.fmuladd.f64(double %27, double %28, double 1.000000e+00)
%30 = fdiv double %17, %29
%31 = fsub double %7, %30
ret double %31
}

LLVM IR (-O2):
define double @rational_approx(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.308000e-03, double 1.892690e-01)
%3 = insertelement <2 x double> poison, double %0, i64 0
%4 = insertelement <2 x double> %3, double %2, i64 1
%5 = insertelement <2 x double> <double 1.032800e-02, double poison>, double %0, i64 1
%6 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %4, <2 x double> %5, <2 x double> <double 8.028530e-01, double 0x3FF6ECB31C219EB6>)
%7 = shufflevector <2 x double> %3, <2 x double> poison, <2 x i32> zeroinitializer
%8 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %6, <2 x double> %7, <2 x double> <double 0x40041FC7607C419A, double 1.000000e+00>)
%9 = extractelement <2 x double> %8, i64 0
%10 = extractelement <2 x double> %8, i64 1
%11 = fdiv double %9, %10
%12 = fsub double %0, %11
ret double %12
}