#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 *, double *);
int main() {
  double x, y = 0;
  int n = 1;
  scanf("%le", &x);
  while (x > 1e-11 || x < -1e-11) {
    y = y + x;
    x = -x * x * x / (2 * n) / (2 * n + 1);
    n = n + 1;
  }
  printf("%f\n", y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
movsd  0xea3(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x1d(%rbp)
ja     117d <main+0x5d>
movsd  0xe96(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    118d <main+0x6d>
jmp    11f4 <main+0xd4>
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <main+0x2e>
movsd  -0x18(%rbp),%xmm0
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
ucomisd 0xec3(%rip),%xmm1
ja     1151 <main+0x31>
xorpd  %xmm0,%xmm0
movsd  0xebd(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    11c5 <main+0xa5>
xorpd  %xmm0,%xmm0
mov    $0x3,%eax
movapd 0xeae(%rip),%xmm2
movsd  0xe96(%rip),%xmm3
movsd  0xe96(%rip),%xmm4
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  %xmm1,%xmm0
movapd %xmm1,%xmm5
xorpd  %xmm2,%xmm5
mulsd  %xmm1,%xmm5
lea    -0x1(%rax),%ecx
xorps  %xmm6,%xmm6
cvtsi2sd %ecx,%xmm6
mulsd  %xmm1,%xmm5
divsd  %xmm6,%xmm5
xorps  %xmm6,%xmm6
cvtsi2sd %eax,%xmm6
movapd %xmm5,%xmm1
divsd  %xmm6,%xmm1
add    $0x2,%eax
ucomisd %xmm3,%xmm1
ja     1180 <main+0x60>
ucomisd %xmm1,%xmm4
ja     1180 <main+0x60>
movsd  %xmm1,(%rsp)
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%le\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
store double 0.000000e+00, double* %3
store i32 1, i32* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
br label %6
6: ; preds = %14, %0
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0x3DA5FD7FE1796495
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load double, double* %2
%11 = fcmp olt double %10, 0xBDA5FD7FE1796495
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ true, %6 ], [ %11, %9 ]
br i1 %13, label %14, label %35
14: ; preds = %12
%15 = load double, double* %3
%16 = load double, double* %2
%17 = fadd double %15, %16
store double %17, double* %3
%18 = load double, double* %2
%19 = fneg double %18
%20 = load double, double* %2
%21 = fmul double %19, %20
%22 = load double, double* %2
%23 = fmul double %21, %22
%24 = load i32, i32* %4
%25 = mul nsw i32 2, %24
%26 = sitofp i32 %25 to double
%27 = fdiv double %23, %26
%28 = load i32, i32* %4
%29 = mul nsw i32 2, %28
%30 = add nsw i32 %29, 1
%31 = sitofp i32 %30 to double
%32 = fdiv double %27, %31
store double %32, double* %2
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %6
35: ; preds = %12
%36 = load double, double* %3
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %36)
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@.str = [4 x i8] c"%le\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @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)
%4 = load double, double* %1
%5 = fcmp ogt double %4, 0x3DA5FD7FE1796495
%6 = fcmp olt double %4, 0xBDA5FD7FE1796495
%7 = or i1 %5, %6
br i1 %7, label %8, label %27
8: ; preds = %0, %8
%9 = phi i32 [ %22, %8 ], [ 1, %0 ]
%10 = phi double [ %12, %8 ], [ 0.000000e+00, %0 ]
%11 = phi double [ %21, %8 ], [ %4, %0 ]
%12 = fadd double %10, %11
%13 = fneg double %11
%14 = fmul double %11, %13
%15 = fmul double %11, %14
%16 = shl nuw nsw i32 %9, 1
%17 = sitofp i32 %16 to double
%18 = fdiv double %15, %17
%19 = or i32 %16, 1
%20 = sitofp i32 %19 to double
%21 = fdiv double %18, %20
%22 = add nuw nsw i32 %9, 1
%23 = fcmp ogt double %21, 0x3DA5FD7FE1796495
%24 = fcmp olt double %21, 0xBDA5FD7FE1796495
%25 = or i1 %23, %24
br i1 %25, label %8, label %26
26: ; preds = %8
store double %21, double* %1
br label %27
27: ; preds = %26, %0
%28 = phi double [ %12, %26 ], [ 0.000000e+00, %0 ]
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %28)
ret i32 0
}