double atan(double x) {
  unsigned char negative = 0;
  if (x < 0) {
    x = 0 - x;
    negative = 1;
  }
  double n0 = .6;
  double n1 = n0 + x;
  double n2 = n1 * x;
  double n3 = n2 * 90.0;
  double d0 = 1.2;
  double d1 = d0 + x;
  double d2 = d1 * x;
  double d3 = d2 + 1.0;
  double atan_n = n3 / d3;
  if (negative) {
    return 0 - atan_n;
  }
  return atan_n;
}


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112c <atan+0x2c>
xorps  %xmm0,%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movb   $0x1,-0x11(%rbp)
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb1(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe64(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
cmpb   $0x0,-0x11(%rbp)
je     11d1 <atan+0xd1>
xorps  %xmm0,%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11db <atan+0xdb>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
xorpd  %xmm2,%xmm2
subsd  %xmm0,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm1,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm0,%xmm3
orpd   %xmm2,%xmm3
unpcklpd %xmm3,%xmm3
movapd 0xecf(%rip),%xmm2
addpd  %xmm3,%xmm2
mulpd  %xmm3,%xmm2
movsd  0xecf(%rip),%xmm0
mulsd  %xmm2,%xmm0
unpckhpd %xmm2,%xmm2
addsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm0
jbe    115f <atan+0x5f>
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @atan(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i8
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %3
store i8 0, i8* %4
%14 = load double, double* %3
%15 = fcmp olt double %14, 0.000000e+00
br i1 %15, label %16, label %19
16: ; preds = %1
%17 = load double, double* %3
%18 = fsub double 0.000000e+00, %17
store double %18, double* %3
store i8 1, i8* %4
br label %19
19: ; preds = %16, %1
store double 6.000000e-01, double* %5
%20 = load double, double* %5
%21 = load double, double* %3
%22 = fadd double %20, %21
store double %22, double* %6
%23 = load double, double* %6
%24 = load double, double* %3
%25 = fmul double %23, %24
store double %25, double* %7
%26 = load double, double* %7
%27 = fmul double %26, 9.000000e+01
store double %27, double* %8
store double 1.200000e+00, double* %9
%28 = load double, double* %9
%29 = load double, double* %3
%30 = fadd double %28, %29
store double %30, double* %10
%31 = load double, double* %10
%32 = load double, double* %3
%33 = fmul double %31, %32
store double %33, double* %11
%34 = load double, double* %11
%35 = fadd double %34, 1.000000e+00
store double %35, double* %12
%36 = load double, double* %8
%37 = load double, double* %12
%38 = fdiv double %36, %37
store double %38, double* %13
%39 = load i8, i8* %4
%40 = icmp ne i8 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %19
%42 = load double, double* %13
%43 = fsub double 0.000000e+00, %42
store double %43, double* %2
br label %46
44: ; preds = %19
%45 = load double, double* %13
store double %45, double* %2
br label %46
46: ; preds = %44, %41
%47 = load double, double* %2
ret double %47
}

LLVM IR (-O2):
define double @atan(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fsub double 0.000000e+00, %0
%4 = select i1 %2, double %3, double %0
%5 = insertelement <2 x double> poison, double %4, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fadd <2 x double> %6, <double 6.000000e-01, double 1.200000e+00>
%8 = fmul <2 x double> %6, %7
%9 = extractelement <2 x double> %8, i64 0
%10 = fmul double %9, 9.000000e+01
%11 = extractelement <2 x double> %8, i64 1
%12 = fadd double %11, 1.000000e+00
%13 = fdiv double %10, %12
%14 = fsub double 0.000000e+00, %13
%15 = select i1 %2, double %14, double %13
ret double %15
}