#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-1);
  assert(fabs(exp(-10.34) - 3.231432266044366e-05) <= 1e-4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xf01(%rip),%xmm0
call   1060 <exp@plt>
lea    0xf05(%rip),%rdi
call   1030 <printf@plt>
movsd  0xed0(%rip),%xmm0
call   1060 <exp@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe9f(%rip),%xmm0
call   1060 <exp@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xebe(%rip),%xmm0
call   1060 <exp@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe55(%rip),%xmm0
call   1060 <exp@plt>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe84(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xe6f(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe52(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xe31(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xe1c(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdff(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xdde(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xdc9(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdac(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xd8b(%rip),%xmm0
call   1060 <exp@plt>
movsd  0xd76(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd59(%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    0xef0(%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>
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-01
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = call double @exp(double -1.034000e+01)
%34 = fsub double %33, 0x3F00F127AC1226EB
%35 = call i32 @fabs(double %34)
%36 = sitofp i32 %35 to double
%37 = fcmp ole double %36, 1.000000e-04
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
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 0.000000e+00)
%19 = icmp slt i32 %18, 1
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
ret i32 0
}