double atan(double x) {
  double xi, q, q2, y;
  int sign;
  xi = (x < 0. ? -x : x);
  q = (xi - 1.0) / (xi + 1.0);
  q2 = q * q;
  y = (((((((-.0040540580 * q2 + .0218612286) * q2 - .0559098861) * q2 +
           .0964200441) *
              q2 -
          .1390853351) *
             q2 +
         .1994653599) *
            q2 -
        .3332985605) *
           q2 +
       .9999993329) *
          q +
      0.785398163397;
  return (x < 0. ? -y : y);
}


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <atan+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1147 <atan+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe41(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe24(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe07(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdea(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdcd(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1270 <atan+0x170>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    127a <atan+0x17a>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
movapd 0xef0(%rip),%xmm1
movapd %xmm0,%xmm3
xorpd  %xmm1,%xmm3
movapd %xmm0,%xmm4
cmpltsd %xmm2,%xmm4
andpd  %xmm4,%xmm3
andnpd %xmm0,%xmm4
orpd   %xmm3,%xmm4
movsd  0xedb(%rip),%xmm2
addsd  %xmm4,%xmm2
addsd  0xed7(%rip),%xmm4
divsd  %xmm4,%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movsd  0xecb(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  0xec7(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  0xec3(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  0xebf(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  0xebb(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  0xeb7(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  0xeb3(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  0xeaf(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xeab(%rip),%xmm0
jbe    11bb <atan+0xbb>
xorpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @atan(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store double %0, double* %2
%8 = load double, double* %2
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %2
%12 = fneg double %11
br label %15
13: ; preds = %1
%14 = load double, double* %2
br label %15
15: ; preds = %13, %10
%16 = phi double [ %12, %10 ], [ %14, %13 ]
store double %16, double* %3
%17 = load double, double* %3
%18 = fsub double %17, 1.000000e+00
%19 = load double, double* %3
%20 = fadd double %19, 1.000000e+00
%21 = fdiv double %18, %20
store double %21, double* %4
%22 = load double, double* %4
%23 = load double, double* %4
%24 = fmul double %22, %23
store double %24, double* %5
%25 = load double, double* %5
%26 = call double @llvm.fmuladd.f64(double 0xBF709AFCE86ADA61, double %25, double 0x3F9662CA378CAD4F)
%27 = load double, double* %5
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double 0xBFACA03878A529DC)
%29 = load double, double* %5
%30 = call double @llvm.fmuladd.f64(double %28, double %29, double 0x3FB8AEFBE8169FED)
%31 = load double, double* %5
%32 = call double @llvm.fmuladd.f64(double %30, double %31, double 0xBFC1CD8C5ACDC925)
%33 = load double, double* %5
%34 = call double @llvm.fmuladd.f64(double %32, double %33, double 0x3FC98814B6BA498F)
%35 = load double, double* %5
%36 = call double @llvm.fmuladd.f64(double %34, double %35, double 0xBFD554C37C49B02B)
%37 = load double, double* %5
%38 = call double @llvm.fmuladd.f64(double %36, double %37, double 0x3FEFFFFE99DA7961)
%39 = load double, double* %4
%40 = call double @llvm.fmuladd.f64(double %38, double %39, double 0x3FE921FB54441D52)
store double %40, double* %6
%41 = load double, double* %2
%42 = fcmp olt double %41, 0.000000e+00
br i1 %42, label %43, label %46
43: ; preds = %15
%44 = load double, double* %6
%45 = fneg double %44
br label %48
46: ; preds = %15
%47 = load double, double* %6
br label %48
48: ; preds = %46, %43
%49 = phi double [ %45, %43 ], [ %47, %46 ]
ret double %49
}

LLVM IR (-O2):
define double @atan(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fadd double %4, -1.000000e+00
%6 = fadd double %4, 1.000000e+00
%7 = fdiv double %5, %6
%8 = fmul double %7, %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0xBF709AFCE86ADA61, double 0x3F9662CA378CAD4F)
%10 = tail call double @llvm.fmuladd.f64(double %9, double %8, double 0xBFACA03878A529DC)
%11 = tail call double @llvm.fmuladd.f64(double %10, double %8, double 0x3FB8AEFBE8169FED)
%12 = tail call double @llvm.fmuladd.f64(double %11, double %8, double 0xBFC1CD8C5ACDC925)
%13 = tail call double @llvm.fmuladd.f64(double %12, double %8, double 0x3FC98814B6BA498F)
%14 = tail call double @llvm.fmuladd.f64(double %13, double %8, double 0xBFD554C37C49B02B)
%15 = tail call double @llvm.fmuladd.f64(double %14, double %8, double 0x3FEFFFFE99DA7961)
%16 = tail call double @llvm.fmuladd.f64(double %15, double %7, double 0x3FE921FB54441D52)
%17 = fneg double %16
%18 = select i1 %2, double %17, double %16
ret double %18
}