#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 */
double M_E;
double M_PI;
double M_PI_2;
double cos(double);
double exp(double);
double log(int);
double pow(double, int);
double sin(double);
double err_bound(int N, double K, double d, double mu) {
  double val = 4.0 / (M_PI * (1 - exp(-M_PI * mu * M_E)));
  val /= (pow(cos(M_PI_2 * sin(d)), 2 * mu) * pow(cos(d), 1 + mu));
  val += mu * exp(M_PI_2 * mu + 1) * pow(2, 1 - mu);
  val *= K / (pow(M_PI, 1 - mu) * d * mu);
  return val * exp(-M_PI * d * N / log(2 * d * N / mu));
}


x86 assembly (clang, -O0):
<err_bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    0x2e77(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x2e67(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    0x2e28(%rip),%rax
mulsd  (%rax),%xmm0
call   1040 <exp@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  0xe47(%rip),%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe3f(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2dff(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
movsd  0xdf3(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <pow@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movsd  0xdd6(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <pow@plt>
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    0x2d78(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd8b(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd69(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xd50(%rip),%xmm0
call   1070 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    0x2d08(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xd1c(%rip),%xmm1
subsd  -0x20(%rbp),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2cbd(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xc9f(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_bound>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    %edi,%r14d
mov    0x2e74(%rip),%rbx
movsd  (%rbx),%xmm0
movapd %xmm0,0x10(%rsp)
xorpd  0xe7a(%rip),%xmm0
mulsd  %xmm2,%xmm0
mov    0x2e3f(%rip),%rax
mulsd  (%rax),%xmm0
call   1040 <exp@plt>
movsd  0xe6e(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  0xe64(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0x2e1b(%rip),%rbp
movsd  0x0(%rbp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
call   1050 <cos@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm1
cvttsd2si %xmm1,%edi
call   1070 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
call   1050 <cos@plt>
movsd  0x8(%rsp),%xmm1
addsd  0xdfb(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1070 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x0(%rbp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0xdca(%rip),%xmm0
call   1040 <exp@plt>
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xdae(%rip),%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%ebp
movsd  0xdae(%rip),%xmm0
mov    %ebp,%edi
call   1070 <pow@plt>
mulsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rbx),%xmm0
mov    %ebp,%edi
call   1070 <pow@plt>
movsd  0x20(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm0
movsd  0x28(%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  (%rbx),%xmm4
xorpd  0xd35(%rip),%xmm4
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
mulsd  %xmm0,%xmm4
movapd %xmm4,0x10(%rsp)
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
divsd  %xmm3,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <log@plt>
movapd 0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <exp@plt>
mulsd  0x28(%rsp),%xmm0
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
@M_E = global double 0.000000e+00
@M_PI_2 = global double 0.000000e+00
define double @err_bound(i32 %0, double %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* @M_PI
%11 = load double, double* @M_PI
%12 = fneg double %11
%13 = load double, double* %8
%14 = fmul double %12, %13
%15 = load double, double* @M_E
%16 = fmul double %14, %15
%17 = call double @exp(double %16)
%18 = fsub double 1.000000e+00, %17
%19 = fmul double %10, %18
%20 = fdiv double 4.000000e+00, %19
store double %20, double* %9
%21 = load double, double* @M_PI_2
%22 = load double, double* %7
%23 = call double @sin(double %22)
%24 = fmul double %21, %23
%25 = call double @cos(double %24)
%26 = load double, double* %8
%27 = fmul double 2.000000e+00, %26
%28 = fptosi double %27 to i32
%29 = call double @pow(double %25, i32 %28)
%30 = load double, double* %7
%31 = call double @cos(double %30)
%32 = load double, double* %8
%33 = fadd double 1.000000e+00, %32
%34 = fptosi double %33 to i32
%35 = call double @pow(double %31, i32 %34)
%36 = fmul double %29, %35
%37 = load double, double* %9
%38 = fdiv double %37, %36
store double %38, double* %9
%39 = load double, double* %8
%40 = load double, double* @M_PI_2
%41 = load double, double* %8
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double 1.000000e+00)
%43 = call double @exp(double %42)
%44 = fmul double %39, %43
%45 = load double, double* %8
%46 = fsub double 1.000000e+00, %45
%47 = fptosi double %46 to i32
%48 = call double @pow(double 2.000000e+00, i32 %47)
%49 = load double, double* %9
%50 = call double @llvm.fmuladd.f64(double %44, double %48, double %49)
store double %50, double* %9
%51 = load double, double* %6
%52 = load double, double* @M_PI
%53 = load double, double* %8
%54 = fsub double 1.000000e+00, %53
%55 = fptosi double %54 to i32
%56 = call double @pow(double %52, i32 %55)
%57 = load double, double* %7
%58 = fmul double %56, %57
%59 = load double, double* %8
%60 = fmul double %58, %59
%61 = fdiv double %51, %60
%62 = load double, double* %9
%63 = fmul double %62, %61
store double %63, double* %9
%64 = load double, double* %9
%65 = load double, double* @M_PI
%66 = fneg double %65
%67 = load double, double* %7
%68 = fmul double %66, %67
%69 = load i32, i32* %5
%70 = sitofp i32 %69 to double
%71 = fmul double %68, %70
%72 = load double, double* %7
%73 = fmul double 2.000000e+00, %72
%74 = load i32, i32* %5
%75 = sitofp i32 %74 to double
%76 = fmul double %73, %75
%77 = load double, double* %8
%78 = fdiv double %76, %77
%79 = fptosi double %78 to i32
%80 = call double @log(i32 %79)
%81 = fdiv double %71, %80
%82 = call double @exp(double %81)
%83 = fmul double %64, %82
ret double %83
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
@M_E = global double 0.000000e+00
@M_PI_2 = global double 0.000000e+00
define double @err_bound(i32 %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fneg double %5
%7 = fmul double %6, %3
%8 = load double, double* @M_E
%9 = fmul double %7, %8
%10 = tail call double @exp(double %9)
%11 = fsub double 1.000000e+00, %10
%12 = fmul double %5, %11
%13 = fdiv double 4.000000e+00, %12
%14 = load double, double* @M_PI_2
%15 = tail call double @sin(double %2)
%16 = fmul double %14, %15
%17 = tail call double @cos(double %16)
%18 = fmul double %3, 2.000000e+00
%19 = fptosi double %18 to i32
%20 = tail call double @pow(double %17, i32 %19)
%21 = tail call double @cos(double %2)
%22 = fadd double %3, 1.000000e+00
%23 = fptosi double %22 to i32
%24 = tail call double @pow(double %21, i32 %23)
%25 = fmul double %20, %24
%26 = fdiv double %13, %25
%27 = load double, double* @M_PI_2
%28 = tail call double @llvm.fmuladd.f64(double %27, double %3, double 1.000000e+00)
%29 = tail call double @exp(double %28)
%30 = fmul double %29, %3
%31 = fsub double 1.000000e+00, %3
%32 = fptosi double %31 to i32
%33 = tail call double @pow(double 2.000000e+00, i32 %32)
%34 = tail call double @llvm.fmuladd.f64(double %30, double %33, double %26)
%35 = load double, double* @M_PI
%36 = tail call double @pow(double %35, i32 %32)
%37 = fmul double %36, %2
%38 = fmul double %37, %3
%39 = fdiv double %1, %38
%40 = fmul double %34, %39
%41 = load double, double* @M_PI
%42 = fneg double %41
%43 = fmul double %42, %2
%44 = sitofp i32 %0 to double
%45 = fmul double %43, %44
%46 = fmul double %2, 2.000000e+00
%47 = fmul double %46, %44
%48 = fdiv double %47, %3
%49 = fptosi double %48 to i32
%50 = tail call double @log(i32 %49)
%51 = fdiv double %45, %50
%52 = tail call double @exp(double %51)
%53 = fmul double %52, %40
ret double %53
}