double atan(f)
double f;
{
  static double coeff_a[] = {33.05861847399,  58.655751569,
                             32.3907948562,   5.853195211263,
                             0.1952374193623, -.002434603300441};
  static double coeff_b[] = {33.05861847399, 69.67529105952, 49.00434821822,
                             12.97557886271, 1.0};
  int recip;
  extern double eval_poly(), fabs();
  double val, val_squared;
  if ((val = fabs(f)) == 0.0)
    return 0.0;
  if (recip = (val > 1.0))
    val = 1.0 / val;
  val_squared = val * val;
  val *=
      eval_poly(val_squared, coeff_a, 5) / eval_poly(val_squared, coeff_b, 4);
  if (recip)
    val = 1.570796326795 - val;
  return f < 0.0 ? -val : val;
}


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xed7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1152 <atan+0x42>
jp     1152 <atan+0x42>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    124e <atan+0x13e>
movsd  -0x20(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x14(%rbp)
test   $0x1,%al
jne    117e <atan+0x6e>
jmp    1190 <atan+0x80>
movsd  0xe8a(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0x2e85(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1030 <eval_poly@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0x2e98(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%al
call   1030 <eval_poly@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1206 <atan+0xf6>
movsd  0xe1c(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    123a <atan+0x12a>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1244 <atan+0x134>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1121 <atan+0x11>
jp     1121 <atan+0x11>
ret
sub    $0x58,%rsp
movapd 0xed3(%rip),%xmm2
movapd %xmm1,0x40(%rsp)
andpd  %xmm1,%xmm2
movapd %xmm2,0x20(%rsp)
movsd  0xedb(%rip),%xmm1
movapd %xmm1,%xmm0
divsd  %xmm2,%xmm0
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
lea    0x2eb7(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1030 <eval_poly@plt>
movapd %xmm0,(%rsp)
lea    0x2ecf(%rip),%rdi
movapd 0x10(%rsp),%xmm0
mov    $0x4,%esi
mov    $0x1,%al
call   1030 <eval_poly@plt>
movapd (%rsp),%xmm3
movapd 0x20(%rsp),%xmm1
ucomisd 0xe6a(%rip),%xmm1
divsd  %xmm0,%xmm3
mulsd  0x30(%rsp),%xmm3
jbe    11d2 <atan+0xc2>
movsd  0xe5e(%rip),%xmm0
subsd  %xmm3,%xmm0
movapd %xmm0,%xmm3
movapd 0xe36(%rip),%xmm0
xorpd  %xmm3,%xmm0
xorpd  %xmm1,%xmm1
movapd 0x40(%rsp),%xmm2
cmpltsd %xmm1,%xmm2
movapd %xmm2,%xmm1
andnpd %xmm3,%xmm1
andpd  %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
@atan.coeff_a = internal global [6 x double] [double 0x40408780CF665D3F, double 0x404D53EFAADB93EE, double 0x4040320590DB697A, double 0x401769AC0165E9E1, double 0x3FC8FD8A2D8EE9FC, double 0xBF63F1BBB1BB6A22]
@atan.coeff_b = internal global [5 x double] [double 0x40408780CF665D3F, double 0x40516B37F7FDFADB, double 0x4048808E7B7F8680, double 0x4029F37F129C0443, double 1.000000e+00]
define double @atan(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store double %0, double* %3
%7 = load double, double* %3
%8 = call double @llvm.fabs.f64(double %7)
store double %8, double* %5
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %1
store double 0.000000e+00, double* %2
br label %44
11: ; preds = %1
%12 = load double, double* %5
%13 = fcmp ogt double %12, 1.000000e+00
%14 = zext i1 %13 to i32
store i32 %14, i32* %4
br i1 %13, label %15, label %18
15: ; preds = %11
%16 = load double, double* %5
%17 = fdiv double 1.000000e+00, %16
store double %17, double* %5
br label %18
18: ; preds = %15, %11
%19 = load double, double* %5
%20 = load double, double* %5
%21 = fmul double %19, %20
store double %21, double* %6
%22 = load double, double* %6
%23 = call double (double, double*, i32, ...) bitcast (double (...)* @eval_poly to double (double, double*, i32, ...)*)(double %22, double* getelementptr inbounds ([6 x double], [6 x double]* @atan.coeff_a, i64 0, i64 0), i32 5)
%24 = load double, double* %6
%25 = call double (double, double*, i32, ...) bitcast (double (...)* @eval_poly to double (double, double*, i32, ...)*)(double %24, double* getelementptr inbounds ([5 x double], [5 x double]* @atan.coeff_b, i64 0, i64 0), i32 4)
%26 = fdiv double %23, %25
%27 = load double, double* %5
%28 = fmul double %27, %26
store double %28, double* %5
%29 = load i32, i32* %4
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %18
%32 = load double, double* %5
%33 = fsub double 0x3FF921FB54442EEA, %32
store double %33, double* %5
br label %34
34: ; preds = %31, %18
%35 = load double, double* %3
%36 = fcmp olt double %35, 0.000000e+00
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load double, double* %5
%39 = fneg double %38
br label %42
40: ; preds = %34
%41 = load double, double* %5
br label %42
42: ; preds = %40, %37
%43 = phi double [ %39, %37 ], [ %41, %40 ]
store double %43, double* %2
br label %44
44: ; preds = %42, %10
%45 = load double, double* %2
ret double %45
}

LLVM IR (-O2):
@atan.coeff_a = internal global [6 x double] [double 0x40408780CF665D3F, double 0x404D53EFAADB93EE, double 0x4040320590DB697A, double 0x401769AC0165E9E1, double 0x3FC8FD8A2D8EE9FC, double 0xBF63F1BBB1BB6A22]
@atan.coeff_b = internal global [5 x double] [double 0x40408780CF665D3F, double 0x40516B37F7FDFADB, double 0x4048808E7B7F8680, double 0x4029F37F129C0443, double 1.000000e+00]
define double @atan(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %18, label %4
4: ; preds = %1
%5 = fcmp ogt double %2, 1.000000e+00
%6 = fdiv double 1.000000e+00, %2
%7 = select i1 %5, double %6, double %2
%8 = fmul double %7, %7
%9 = tail call double (double, double*, i32, ...) bitcast (double (...)* @eval_poly to double (double, double*, i32, ...)*)(double %8, double* getelementptr inbounds ([6 x double], [6 x double]* @atan.coeff_a, i64 0, i64 0), i32 5)
%10 = tail call double (double, double*, i32, ...) bitcast (double (...)* @eval_poly to double (double, double*, i32, ...)*)(double %8, double* getelementptr inbounds ([5 x double], [5 x double]* @atan.coeff_b, i64 0, i64 0), i32 4)
%11 = fdiv double %9, %10
%12 = fmul double %7, %11
%13 = fsub double 0x3FF921FB54442EEA, %12
%14 = select i1 %5, double %13, double %12
%15 = fcmp olt double %0, 0.000000e+00
%16 = fneg double %14
%17 = select i1 %15, double %16, double %14
br label %18
18: ; preds = %1, %4
%19 = phi double [ %17, %4 ], [ 0.000000e+00, %1 ]
ret double %19
}