double _sqrt(double x) {
  long i;
  double x2, y;
  const double z = 1.5F;
  x2 = x * 0.5F;
  y = x;
  i = *(long *)&y;
  i = 0x5fe6eb50c7b537a9 - (i >> 1);
  y = *(double *)&i;
  y = y * (z - (x2 * y * y));
  y = y * (z - (x2 * y * y));
  y = y * (z - (x2 * y * y));
  return y;
}


x86 assembly (clang, -O0):
<_sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeea(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
movabs $0x5fe6eb50c7b537a9,%rax
eb e6 5f
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe6c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe28(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xde4(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sqrt>:
movq   %xmm0,%rax
sar    %rax
movabs $0x5fe6eb50c7b537a9,%rcx
eb e6 5f
sub    %rax,%rcx
movq   %rcx,%xmm1
mulsd  0xede(%rip),%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  0xed2(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @_sqrt(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %2
store double 1.500000e+00, double* %6
%7 = load double, double* %2
%8 = fmul double %7, 5.000000e-01
store double %8, double* %4
%9 = load double, double* %2
store double %9, double* %5
%10 = bitcast double* %5 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = ashr i64 %12, 1
%14 = sub nsw i64 6910469410427058089, %13
store i64 %14, i64* %3
%15 = bitcast i64* %3 to double*
%16 = load double, double* %15
store double %16, double* %5
%17 = load double, double* %5
%18 = load double, double* %4
%19 = load double, double* %5
%20 = fmul double %18, %19
%21 = load double, double* %5
%22 = fneg double %20
%23 = call double @llvm.fmuladd.f64(double %22, double %21, double 1.500000e+00)
%24 = fmul double %17, %23
store double %24, double* %5
%25 = load double, double* %5
%26 = load double, double* %4
%27 = load double, double* %5
%28 = fmul double %26, %27
%29 = load double, double* %5
%30 = fneg double %28
%31 = call double @llvm.fmuladd.f64(double %30, double %29, double 1.500000e+00)
%32 = fmul double %25, %31
store double %32, double* %5
%33 = load double, double* %5
%34 = load double, double* %4
%35 = load double, double* %5
%36 = fmul double %34, %35
%37 = load double, double* %5
%38 = fneg double %36
%39 = call double @llvm.fmuladd.f64(double %38, double %37, double 1.500000e+00)
%40 = fmul double %33, %39
store double %40, double* %5
%41 = load double, double* %5
ret double %41
}

LLVM IR (-O2):
define double @_sqrt(double %0) {
%2 = bitcast double %0 to i64
%3 = ashr i64 %2, 1
%4 = sub nsw i64 6910469410427058089, %3
%5 = bitcast i64 %4 to double
%6 = fmul double %0, -5.000000e-01
%7 = fmul double %6, %5
%8 = tail call double @llvm.fmuladd.f64(double %7, double %5, double 1.500000e+00)
%9 = fmul double %8, %5
%10 = fmul double %6, %9
%11 = tail call double @llvm.fmuladd.f64(double %10, double %9, double 1.500000e+00)
%12 = fmul double %9, %11
%13 = fmul double %6, %12
%14 = tail call double @llvm.fmuladd.f64(double %13, double %12, double 1.500000e+00)
%15 = fmul double %12, %14
ret double %15
}