#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*/ assert(int);
double exp(double);
int fabs(double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("%.16f \n", exp(-45));
  printf("%.16f \n", exp(-0.14115125));
  printf("%.16f \n", exp(2.132314121515));
  printf("%.16f \n", exp(-3.1123441));
  printf("%.16f \n", exp(-100.34));
  assert(fabs(exp(-45) - 0.0000000000000000) <= 1e-8);
  assert(fabs(exp(-0.14115125) - 0.8683579626227979) <= 1e-9);
  assert(fabs(exp(2.132314121515) - 8.4343623846368754) <= 1e-8);
  assert(fabs(exp(-3.1123441) - 0.0444965286819433) <= 1e-7);
  assert(fabs(exp(-100.34) - 0.0000000000000000) <= 1e-9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xef9(%rip),%xmm0
call   1060 <exp@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
call   1060 <exp@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeaf(%rip),%xmm0
call   1060 <exp@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe7e(%rip),%xmm0
call   1060 <exp@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe4d(%rip),%xmm0
call   1060 <exp@plt>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe7c(%rip),%xmm0
call   1060 <exp@plt>
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe37(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xe3e(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xe29(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdd4(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xdf3(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xdde(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdc1(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xda0(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xd8b(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd6e(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xd4d(%rip),%xmm0
call   1060 <exp@plt>
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd28(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef8(%rip),%rbx
movsd  0xec0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xeb8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xeb0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xea8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xea0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xe70(%rip),%xmm0
call   1040 <fabs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1050 <assert@plt>
xorps  %xmm0,%xmm0
call   1040 <fabs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1050 <assert@plt>
xorps  %xmm0,%xmm0
call   1040 <fabs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1050 <assert@plt>
movsd  0xe54(%rip),%xmm0
call   1040 <fabs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1050 <assert@plt>
movsd  0xe32(%rip),%xmm0
call   1040 <fabs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%.16f \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @exp(double -4.500000e+01)
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @exp(double 0xBFC2113E81450EFE)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %4)
%6 = call double @exp(double 0x40010EFAB4C5A5AC)
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call double @exp(double 0xC008E614A9DB303D)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %8)
%10 = call double @exp(double -1.003400e+02)
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %10)
%12 = call double @exp(double -4.500000e+01)
%13 = fsub double %12, 0.000000e+00
%14 = call i32 @fabs(double %13)
%15 = sitofp i32 %14 to double
%16 = fcmp ole double %15, 1.000000e-08
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = call double @exp(double 0xBFC2113E81450EFE)
%20 = fsub double %19, 0x3FEBC996A355F497
%21 = call i32 @fabs(double %20)
%22 = sitofp i32 %21 to double
%23 = fcmp ole double %22, 1.000000e-09
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call double @exp(double 0x40010EFAB4C5A5AC)
%27 = fsub double %26, 0x4020DE64BF194183
%28 = call i32 @fabs(double %27)
%29 = sitofp i32 %28 to double
%30 = fcmp ole double %29, 1.000000e-08
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = call double @exp(double 0xC008E614A9DB303D)
%34 = fsub double %33, 0x3FA6C83FBEF2EE0E
%35 = call i32 @fabs(double %34)
%36 = sitofp i32 %35 to double
%37 = fcmp ole double %36, 0x3E7AD7F29ABCAF48
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
%40 = call double @exp(double -1.003400e+02)
%41 = fsub double %40, 0.000000e+00
%42 = call i32 @fabs(double %41)
%43 = sitofp i32 %42 to double
%44 = fcmp ole double %43, 1.000000e-09
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%.16f \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x3BE0E5B73D1FF53D)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x3FEBC996A355F497)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x4020DE64BF194183)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x3FA6C83FBEF2EE0D)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x36E2E5470C49F7F0)
%6 = tail call i32 @fabs(double 0x3BE0E5B73D1FF53D)
%7 = icmp slt i32 %6, 1
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @fabs(double 0.000000e+00)
%11 = icmp slt i32 %10, 1
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i32 @fabs(double 0.000000e+00)
%15 = icmp slt i32 %14, 1
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i32 @fabs(double 0xBC60000000000000)
%19 = icmp slt i32 %18, 1
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = tail call i32 @fabs(double 0x36E2E5470C49F7F0)
%23 = icmp slt i32 %22, 1
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
ret i32 0
}