#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 pow(double, double);
double sqrt(double);
double small_tau(double tau) {
  int n;
  double nfacul, beta;
  beta = 0e0;
  nfacul = 1e0;
  n = 0;
  beta = pow(-1e0, (double)n) * pow(tau, (double)n) /
         (nfacul * sqrt((double)n + 1e0) * pow(3.1415926536, (double)n / 2e0));
  for (n = 1; n < 100; n++) {
    nfacul = nfacul * (double)n;
    beta = beta + pow(-1e0, (double)n) * pow(tau, (double)n) /
                      (nfacul * sqrt((double)n + 1e0) *
                       pow(3.1415926536, (double)n / 2e0));
  }
  return beta;
}


x86 assembly (clang, -O0):
<small_tau>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xec2(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe79(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe4a(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe36(%rip),%xmm0
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    12ce <small_tau+0x1ae>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xdf4(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xdab(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xd7c(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xd68(%rip),%xmm0
call   1030 <pow@plt>
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f0 <small_tau+0xd0>
movsd  -0x20(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_tau>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm0,0x20(%rsp)
movsd  0xecd(%rip),%xmm0
mov    $0x63,%ebx
movapd %xmm0,%xmm2
movsd  %xmm0,0x10(%rsp)
movapd %xmm0,%xmm1
jmp    11d5 <small_tau+0xb5>
nopl   0x0(%rax,%rax,1)
movsd  %xmm3,0x8(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm3
movsd  (%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm1,%xmm2
movsd  0x18(%rsp),%xmm4
mulsd  %xmm3,%xmm4
movsd  %xmm4,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  0xe78(%rip),%xmm1
movsd  0xe78(%rip),%xmm0
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm3
divsd  %xmm0,%xmm3
movsd  0x28(%rsp),%xmm2
addsd  %xmm3,%xmm2
movsd  0xe34(%rip),%xmm0
addsd  %xmm0,%xmm1
add    $0xffffffff,%ebx
je     122f <small_tau+0x10f>
movsd  %xmm1,(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  0xe20(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm3
movapd %xmm1,%xmm0
addsd  0xde8(%rip),%xmm0
ucomisd 0xe00(%rip),%xmm0
jb     1150 <small_tau+0x30>
sqrtsd %xmm0,%xmm0
jmp    1166 <small_tau+0x46>
movapd %xmm2,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @small_tau(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %5
store double 1.000000e+00, double* %4
store i32 0, i32* %3
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = call double @pow(double -1.000000e+00, double %7)
%9 = load double, double* %2
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = call double @pow(double %9, double %11)
%13 = fmul double %8, %12
%14 = load double, double* %4
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = fadd double %16, 1.000000e+00
%18 = call double @sqrt(double %17)
%19 = fmul double %14, %18
%20 = load i32, i32* %3
%21 = sitofp i32 %20 to double
%22 = fdiv double %21, 2.000000e+00
%23 = call double @pow(double 0x400921FB544486E0, double %22)
%24 = fmul double %19, %23
%25 = fdiv double %13, %24
store double %25, double* %5
store i32 1, i32* %3
br label %26
26: ; preds = %56, %1
%27 = load i32, i32* %3
%28 = icmp slt i32 %27, 100
br i1 %28, label %29, label %59
29: ; preds = %26
%30 = load double, double* %4
%31 = load i32, i32* %3
%32 = sitofp i32 %31 to double
%33 = fmul double %30, %32
store double %33, double* %4
%34 = load double, double* %5
%35 = load i32, i32* %3
%36 = sitofp i32 %35 to double
%37 = call double @pow(double -1.000000e+00, double %36)
%38 = load double, double* %2
%39 = load i32, i32* %3
%40 = sitofp i32 %39 to double
%41 = call double @pow(double %38, double %40)
%42 = fmul double %37, %41
%43 = load double, double* %4
%44 = load i32, i32* %3
%45 = sitofp i32 %44 to double
%46 = fadd double %45, 1.000000e+00
%47 = call double @sqrt(double %46)
%48 = fmul double %43, %47
%49 = load i32, i32* %3
%50 = sitofp i32 %49 to double
%51 = fdiv double %50, 2.000000e+00
%52 = call double @pow(double 0x400921FB544486E0, double %51)
%53 = fmul double %48, %52
%54 = fdiv double %42, %53
%55 = fadd double %34, %54
store double %55, double* %5
br label %56
56: ; preds = %29
%57 = load i32, i32* %3
%58 = add nsw i32 %57, 1
store i32 %58, i32* %3
br label %26
59: ; preds = %26
%60 = load double, double* %5
ret double %60
}

LLVM IR (-O2):
define double @small_tau(double %0) {
br label %2
2: ; preds = %1, %2
%3 = phi double [ 1.000000e+00, %1 ], [ %18, %2 ]
%4 = phi double [ 1.000000e+00, %1 ], [ %7, %2 ]
%5 = phi i32 [ 1, %1 ], [ %19, %2 ]
%6 = sitofp i32 %5 to double
%7 = fmul double %4, %6
%8 = tail call double @pow(double -1.000000e+00, double %6)
%9 = tail call double @pow(double %0, double %6)
%10 = fmul double %8, %9
%11 = fadd double %6, 1.000000e+00
%12 = tail call double @sqrt(double %11)
%13 = fmul double %7, %12
%14 = fmul double %6, 5.000000e-01
%15 = tail call double @pow(double 0x400921FB544486E0, double %14)
%16 = fmul double %13, %15
%17 = fdiv double %10, %16
%18 = fadd double %3, %17
%19 = add nuw nsw i32 %5, 1
%20 = icmp eq i32 %19, 100
br i1 %20, label %21, label %2
21: ; preds = %2
ret double %18
}