#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(0.3));
  printf("%.16f \n", exp(0.14115125));
  printf("%.16f \n", exp(-2.132314121515));
  printf("%.16f \n", exp(3.1123441));
  printf("%.16f \n", exp(-10.34));
  assert(fabs(exp(0.3) - 1.3498588075760032) <= 1e-8);
  assert(fabs(exp(0.14115125) - 1.1515988141337348) <= 1e-9);
  assert(fabs(exp(-2.132314121515) - 0.11856260786488046) <= 1e-10);
  assert(fabs(exp(3.1123441) - 22.4736632187176717) <= 1e-7);
  assert(fabs(exp(-10.34) - 3.231432266044366e-05) <= 1e-10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xf11(%rip),%xmm0
call   1060 <exp@plt>
lea    0xf0d(%rip),%rdi
call   1030 <printf@plt>
movsd  0xee0(%rip),%xmm0
call   1060 <exp@plt>
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeaf(%rip),%xmm0
call   1060 <exp@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe86(%rip),%xmm0
call   1060 <exp@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe55(%rip),%xmm0
call   1060 <exp@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe94(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xe7f(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe62(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xe41(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xe2c(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe0f(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xdee(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xdd9(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd94(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xda3(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xd8e(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd71(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xd50(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xd3b(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd1e(%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>
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>
xorps  %xmm0,%xmm0
call   1040 <fabs@plt>
xor    %edi,%edi
test   %eax,%eax
setle  %dil
call   1050 <assert@plt>
movsd  0xe59(%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>
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 3.000000e-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 0x3FC2113E81450EFE)
%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 0xC0010EFAB4C5A5AC)
%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 0x4008E614A9DB303D)
%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.034000e+01)
%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 3.000000e-01)
%13 = fsub double %12, 0x3FF599058C8C1A96
%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 0x3FC2113E81450EFE)
%20 = fsub double %19, 0x3FF26CF2E0CD1181
%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 0xC0010EFAB4C5A5AC)
%27 = fsub double %26, 0x3FBE5A1E7B4EE1DE
%28 = call i32 @fabs(double %27)
%29 = sitofp i32 %28 to double
%30 = fcmp ole double %29, 1.000000e-10
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = call double @exp(double 0x4008E614A9DB303D)
%34 = fsub double %33, 0x40367941FE21B5E3
%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.034000e+01)
%41 = fsub double %40, 0x3F00F127AC1226EB
%42 = call i32 @fabs(double %41)
%43 = sitofp i32 %42 to double
%44 = fcmp ole double %43, 1.000000e-10
%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 0x3FF599058C8C1A96)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x3FF26CF2E0CD1181)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x3FBE5A1E7B4EE1DE)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x40367941FE21B5C4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double 0x3F00F127AC1226EB)
%6 = tail call i32 @fabs(double 0.000000e+00)
%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 0xBD3F000000000000)
%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 0.000000e+00)
%23 = icmp slt i32 %22, 1
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
ret i32 0
}