#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int fabs(double);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ stdin;
void main() {
  double x0, x1, a;
  scanf("%lf", &a);
  x0 = 6.5;
  while (1) {
    x1 = (x0 + a / x0) / 2;
    if (fabs(x1 - x0) < 1e-10)
      break;
    x0 = x1;
  }
  printf("%.10f\n", x1);
  fflush(stdin);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb9(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <scanf@plt>
movsd  0xe90(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
divsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe80(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe54(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c3 <main+0x73>
jmp    11d2 <main+0x82>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1175 <main+0x25>
movsd  -0x10(%rbp),%xmm0
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeb5(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1070 <scanf@plt>
movsd  0xe93(%rip),%xmm0
nopl   (%rax)
movapd %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xe7e(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
movsd  0x8(%rsp),%xmm0
test   %eax,%eax
jg     1170 <main+0x20>
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.10f\0A\00"
@stdin = global i32 0
define void @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
store double 6.500000e+00, double* %1
br label %5
5: ; preds = %0, %19
%6 = load double, double* %1
%7 = load double, double* %3
%8 = load double, double* %1
%9 = fdiv double %7, %8
%10 = fadd double %6, %9
%11 = fdiv double %10, 2.000000e+00
store double %11, double* %2
%12 = load double, double* %2
%13 = load double, double* %1
%14 = fsub double %12, %13
%15 = call i32 @fabs(double %14)
%16 = sitofp i32 %15 to double
%17 = fcmp olt double %16, 1.000000e-10
br i1 %17, label %18, label %19
18: ; preds = %5
br label %21
19: ; preds = %5
%20 = load double, double* %2
store double %20, double* %1
br label %5
21: ; preds = %18
%22 = load double, double* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %22)
%24 = load i32, i32* @stdin
%25 = call i32 @fflush(i32 %24)
%26 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.10f\0A\00"
@stdin = global i32 0
define void @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
br label %4
4: ; preds = %4, %0
%5 = phi double [ 6.500000e+00, %0 ], [ %9, %4 ]
%6 = load double, double* %1
%7 = fdiv double %6, %5
%8 = fadd double %5, %7
%9 = fmul double %8, 5.000000e-01
%10 = fsub double %9, %5
%11 = call i32 @fabs(double %10)
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %9)
%15 = load i32, i32* @stdin
%16 = call i32 @fflush(i32 %15)
%17 = call i32 (...) @getchar()
ret void
}