#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 /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int q;
  double x;
  while (1) {
    scanf("%d", &q);
    if (q == -1)
      break;
    x = q / 2.0;
    while (x * x * x - q <= -0.00001 * q || 0.00001 * q <= x * x * x - q) {
      x = x - (x * x * x - q) / (3 * x * x);
    }
    printf("%lf\n", x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
jne    114e <main+0x2e>
jmp    1287 <main+0x167>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
cvtsi2sdl -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm2
movsd  0xe64(%rip),%xmm0
mulsd  %xmm2,%xmm0
mov    $0x1,%al
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jae    1205 <main+0xe5>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe4c(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm3
cvtsi2sdl -0x8(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1215 <main+0xf5>
jmp    1271 <main+0x151>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm3
cvtsi2sdl -0x8(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0xdc3(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1164 <main+0x44>
movsd  -0x10(%rbp),%xmm0
lea    0xda6(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf00(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0xffffffff,%eax
je     1229 <main+0x109>
lea    0xee5(%rip),%r14
lea    0xedb(%rip),%r15
lea    0xc(%rsp),%rbx
movsd  0xeb6(%rip),%xmm6
jmp    1198 <main+0x78>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movsd  0xe8d(%rip),%xmm6
mov    0xc(%rsp),%eax
cmp    $0xffffffff,%eax
je     1229 <main+0x109>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movapd %xmm1,%xmm0
mulsd  0xe55(%rip),%xmm0
movapd %xmm1,%xmm2
mulsd  0xe51(%rip),%xmm2
movapd %xmm1,%xmm3
mulsd  0xe4d(%rip),%xmm3
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm0,%xmm4
subsd  %xmm1,%xmm4
ucomisd %xmm4,%xmm2
jae    11df <main+0xbf>
ucomisd %xmm3,%xmm4
jb     1170 <main+0x50>
xorpd  0xe39(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
movapd %xmm0,%xmm5
mulsd  %xmm6,%xmm0
mulsd  %xmm5,%xmm0
divsd  %xmm0,%xmm4
movapd %xmm4,%xmm0
addsd  %xmm5,%xmm0
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm1,%xmm4
ucomisd %xmm4,%xmm2
jae    11f0 <main+0xd0>
ucomisd %xmm3,%xmm4
jae    11f0 <main+0xd0>
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
br label %4
4: ; preds = %0, %57
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %4
br label %60
9: ; preds = %4
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 2.000000e+00
store double %12, double* %3
br label %13
13: ; preds = %41, %9
%14 = load double, double* %3
%15 = load double, double* %3
%16 = fmul double %14, %15
%17 = load double, double* %3
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to double
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %16, double %17, double %20)
%22 = load i32, i32* %2
%23 = sitofp i32 %22 to double
%24 = fmul double -1.000000e-05, %23
%25 = fcmp ole double %21, %24
br i1 %25, label %39, label %26
26: ; preds = %13
%27 = load i32, i32* %2
%28 = sitofp i32 %27 to double
%29 = fmul double 1.000000e-05, %28
%30 = load double, double* %3
%31 = load double, double* %3
%32 = fmul double %30, %31
%33 = load double, double* %3
%34 = load i32, i32* %2
%35 = sitofp i32 %34 to double
%36 = fneg double %35
%37 = call double @llvm.fmuladd.f64(double %32, double %33, double %36)
%38 = fcmp ole double %29, %37
br label %39
39: ; preds = %26, %13
%40 = phi i1 [ true, %13 ], [ %38, %26 ]
br i1 %40, label %41, label %57
41: ; preds = %39
%42 = load double, double* %3
%43 = load double, double* %3
%44 = load double, double* %3
%45 = fmul double %43, %44
%46 = load double, double* %3
%47 = load i32, i32* %2
%48 = sitofp i32 %47 to double
%49 = fneg double %48
%50 = call double @llvm.fmuladd.f64(double %45, double %46, double %49)
%51 = load double, double* %3
%52 = fmul double 3.000000e+00, %51
%53 = load double, double* %3
%54 = fmul double %52, %53
%55 = fdiv double %50, %54
%56 = fsub double %42, %55
store double %56, double* %3
br label %13
57: ; preds = %39
%58 = load double, double* %3
%59 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %58)
br label %4
60: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %36, label %6
6: ; preds = %0, %30
%7 = phi i32 [ %34, %30 ], [ %4, %0 ]
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 5.000000e-01
%10 = fneg double %8
%11 = fmul double %8, -1.000000e-05
%12 = fmul double %8, 1.000000e-05
%13 = fmul double %9, %9
%14 = call double @llvm.fmuladd.f64(double %13, double %9, double %10)
%15 = fcmp ugt double %14, %11
%16 = fcmp ugt double %12, %14
%17 = and i1 %15, %16
br i1 %17, label %30, label %18
18: ; preds = %6, %18
%19 = phi double [ %26, %18 ], [ %14, %6 ]
%20 = phi double [ %24, %18 ], [ %9, %6 ]
%21 = fmul double %20, 3.000000e+00
%22 = fmul double %20, %21
%23 = fdiv double %19, %22
%24 = fsub double %20, %23
%25 = fmul double %24, %24
%26 = call double @llvm.fmuladd.f64(double %25, double %24, double %10)
%27 = fcmp ugt double %26, %11
%28 = fcmp ugt double %12, %26
%29 = and i1 %27, %28
br i1 %29, label %30, label %18
30: ; preds = %18, %6
%31 = phi double [ %9, %6 ], [ %24, %18 ]
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %31)
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%34 = load i32, i32* %1
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %6
36: ; preds = %30, %0
ret i32 0
}