#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 f(double);
int /*<<< orphan*/ printf(char *, double, double, int);
int /*<<< orphan*/ scanf(char *, int *, double *, double *);
main() {
  int n;
  double x, dx;
  scanf("%d %lf %lf", &n, &x, &dx);
  while (n--) {
    printf("%lf %lf %lf\n", dx, (f(x + dx) - f(x)) / dx,
           (f(x + dx) - f(x - dx)) / (2 * dx));
    dx /= 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1218 <main+0xe8>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1030 <f@plt>
mov    %eax,-0x34(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1030 <f@plt>
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <f@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm2
movsd  0xe1c(%rip),%xmm3
mulsd  -0x18(%rbp),%xmm3
divsd  %xmm3,%xmm2
cvttsd2si %xmm2,%esi
lea    0xe1b(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xdf6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <main+0x27>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
lea    0xecb(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <scanf@plt>
subl   $0x1,0xc(%rsp)
jb     1212 <main+0xe2>
movsd  (%rsp),%xmm1
lea    0xead(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm1,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
call   1030 <f@plt>
mov    %eax,%ebp
movsd  0x10(%rsp),%xmm0
call   1030 <f@plt>
sub    %eax,%ebp
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
addsd  0x10(%rsp),%xmm0
call   1030 <f@plt>
mov    %eax,%ebp
movsd  0x10(%rsp),%xmm0
subsd  (%rsp),%xmm0
call   1030 <f@plt>
sub    %eax,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    %rbx,%rdi
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
call   1040 <printf@plt>
movsd  (%rsp),%xmm1
mulsd  0xdfe(%rip),%xmm1
movsd  %xmm1,(%rsp)
subl   $0x1,0xc(%rsp)
jae    1170 <main+0x40>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d %lf %lf\00"
@.str.1 = [13 x i8] c"%lf %lf %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %1, double* %2, double* %3)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp eq i32 %8, 0
br i1 %10, label %43, label %11
11: ; preds = %0
%12 = load double, double* %3
br label %13
13: ; preds = %11, %13
%14 = phi double [ %12, %11 ], [ %39, %13 ]
%15 = load double, double* %2
%16 = fadd double %14, %15
%17 = call i32 @f(double %16)
%18 = load double, double* %2
%19 = call i32 @f(double %18)
%20 = sub nsw i32 %17, %19
%21 = sitofp i32 %20 to double
%22 = load double, double* %3
%23 = fdiv double %21, %22
%24 = load double, double* %2
%25 = fadd double %22, %24
%26 = call i32 @f(double %25)
%27 = load double, double* %2
%28 = load double, double* %3
%29 = fsub double %27, %28
%30 = call i32 @f(double %29)
%31 = sub nsw i32 %26, %30
%32 = sitofp i32 %31 to double
%33 = load double, double* %3
%34 = fmul double %33, 2.000000e+00
%35 = fdiv double %32, %34
%36 = fptosi double %35 to i32
%37 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %14, double %23, i32 %36)
%38 = load double, double* %3
%39 = fmul double %38, 5.000000e-01
store double %39, double* %3
%40 = load i32, i32* %1
%41 = add nsw i32 %40, -1
store i32 %41, i32* %1
%42 = icmp eq i32 %40, 0
br i1 %42, label %43, label %13
43: ; preds = %13, %0
ret i32 0
}