double smallpos_gamma(x)
double x;
{
  static double p[11] = {
      -0.2983543278574342138830437659e+06, -0.2384953970018198872468734423e+06,
      -0.1170494760121780688403854445e+06, -0.3949445048301571936421824091e+05,
      -0.1046699423827521405330650531e+05, -0.2188218110071816359394795998e+04,
      -0.3805112208641734657584922631e+03, -0.5283123755635845383718978382e+02,
      -0.6128571763704498306889428212e+01, -0.5028018054416812467364198750e+00,
      -0.3343060322330595274515660112e-01};
  static double q[9] = {
      -0.2983543278574342138830438524e+06, -0.1123558608748644911342306408e+06,
      0.5332716689118142157485686311e+05,  0.8571160498907043851961147763e+04,
      -0.4734865977028211706556819770e+04, 0.1960497612885585838997039621e+03,
      0.1257733367869888645966647426e+03,  -0.2053126153100672764513929067e+02,
      0.1000000000000000000000000000e+01};
  double result = 1.0;
  while (x > 3) {
    x -= 1.0;
    result *= x;
  }
  while (x < 2) {
    result /= x;
    x += 1.0;
  }
  x -= 2.0;
  return result * POLYNOM10(x, p) / POLYNOM8(x, q);
}


x86 assembly (clang, -O0):
<smallpos_gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117b <smallpos_gamma+0x5b>
movsd  -0x8(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    113a <smallpos_gamma+0x1a>
jmp    1180 <smallpos_gamma+0x60>
movsd  0xe88(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11bd <smallpos_gamma+0x9d>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe52(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <smallpos_gamma+0x60>
movsd  -0x8(%rbp),%xmm0
movsd  0xe46(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0x2e57(%rip),%rdi
mov    $0x1,%al
call   1030 <POLYNOM10@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0x2e92(%rip),%rdi
mov    $0x1,%al
call   1040 <POLYNOM8@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallpos_gamma>:
sub    $0x18,%rsp
movsd  0xed4(%rip),%xmm3
ucomisd 0xed4(%rip),%xmm0
jbe    115e <smallpos_gamma+0x3e>
movsd  0xed2(%rip),%xmm2
movsd  0xec2(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm3
ucomisd %xmm1,%xmm0
ja     1150 <smallpos_gamma+0x30>
movsd  0xeb2(%rip),%xmm2
ucomisd %xmm0,%xmm2
jbe    118e <smallpos_gamma+0x6e>
movsd  0xe8c(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
divsd  %xmm0,%xmm3
addsd  %xmm1,%xmm0
ucomisd %xmm0,%xmm2
ja     1180 <smallpos_gamma+0x60>
movsd  %xmm3,0x8(%rsp)
addsd  0xe84(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0x2e97(%rip),%rdi
mov    $0x1,%al
call   1030 <POLYNOM10@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x2ed6(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <POLYNOM8@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@smallpos_gamma.p = internal global [11 x double] [double 0xC11235C94FB9DBF7, double 0xC10D1CFB2D0F4A47, double 0xC0FC93979DBEF215, double 0xC0E348CE6A5B5B7D, double 0xC0C4717F4333263D, double 0xC0A1186FAC1F92C2, double 0xC077C82DF5EDCA87, double 0xC04A6A65FE03E21D, double 0xC01883A85101330F, double 0xBFE016F3CFD7BCA1, double 0xBFA11DD0E70F2E73]
@smallpos_gamma.q = internal global [9 x double] [double 0xC11235C94FB9DBF7, double 0xC0FB6E3DC624B8CF, double 0x40EA09E5572C2CC6, double 0x40C0BD948B3A6A66, double 0xC0B27EDDB0ABA742, double 0x40688197A4FC5EE9, double 0x405F717E59943A4C, double 0xC0348800C1754BFA, double 1.000000e+00]
define double @smallpos_gamma(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %3
br label %4
4: ; preds = %7, %1
%5 = load double, double* %2
%6 = fcmp ogt double %5, 3.000000e+00
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load double, double* %2
%9 = fsub double %8, 1.000000e+00
store double %9, double* %2
%10 = load double, double* %2
%11 = load double, double* %3
%12 = fmul double %11, %10
store double %12, double* %3
br label %4
13: ; preds = %4
br label %14
14: ; preds = %17, %13
%15 = load double, double* %2
%16 = fcmp olt double %15, 2.000000e+00
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load double, double* %2
%19 = load double, double* %3
%20 = fdiv double %19, %18
store double %20, double* %3
%21 = load double, double* %2
%22 = fadd double %21, 1.000000e+00
store double %22, double* %2
br label %14
23: ; preds = %14
%24 = load double, double* %2
%25 = fsub double %24, 2.000000e+00
store double %25, double* %2
%26 = load double, double* %3
%27 = load double, double* %2
%28 = call i32 (double, double*, ...) bitcast (i32 (...)* @POLYNOM10 to i32 (double, double*, ...)*)(double %27, double* getelementptr inbounds ([11 x double], [11 x double]* @smallpos_gamma.p, i64 0, i64 0))
%29 = sitofp i32 %28 to double
%30 = fmul double %26, %29
%31 = load double, double* %2
%32 = call i32 (double, double*, ...) bitcast (i32 (...)* @POLYNOM8 to i32 (double, double*, ...)*)(double %31, double* getelementptr inbounds ([9 x double], [9 x double]* @smallpos_gamma.q, i64 0, i64 0))
%33 = sitofp i32 %32 to double
%34 = fdiv double %30, %33
ret double %34
}

LLVM IR (-O2):
@smallpos_gamma.p = internal global [11 x double] [double 0xC11235C94FB9DBF7, double 0xC10D1CFB2D0F4A47, double 0xC0FC93979DBEF215, double 0xC0E348CE6A5B5B7D, double 0xC0C4717F4333263D, double 0xC0A1186FAC1F92C2, double 0xC077C82DF5EDCA87, double 0xC04A6A65FE03E21D, double 0xC01883A85101330F, double 0xBFE016F3CFD7BCA1, double 0xBFA11DD0E70F2E73]
@smallpos_gamma.q = internal global [9 x double] [double 0xC11235C94FB9DBF7, double 0xC0FB6E3DC624B8CF, double 0x40EA09E5572C2CC6, double 0x40C0BD948B3A6A66, double 0xC0B27EDDB0ABA742, double 0x40688197A4FC5EE9, double 0x405F717E59943A4C, double 0xC0348800C1754BFA, double 1.000000e+00]
define double @smallpos_gamma(double %0) {
%2 = fcmp ogt double %0, 3.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %7, %1
%4 = phi double [ %0, %1 ], [ %10, %7 ]
%5 = phi double [ 1.000000e+00, %1 ], [ %11, %7 ]
%6 = fcmp olt double %4, 2.000000e+00
br i1 %6, label %13, label %19
7: ; preds = %1, %7
%8 = phi double [ %11, %7 ], [ 1.000000e+00, %1 ]
%9 = phi double [ %10, %7 ], [ %0, %1 ]
%10 = fadd double %9, -1.000000e+00
%11 = fmul double %8, %10
%12 = fcmp ogt double %10, 3.000000e+00
br i1 %12, label %7, label %3
13: ; preds = %3, %13
%14 = phi double [ %16, %13 ], [ %5, %3 ]
%15 = phi double [ %17, %13 ], [ %4, %3 ]
%16 = fdiv double %14, %15
%17 = fadd double %15, 1.000000e+00
%18 = fcmp olt double %17, 2.000000e+00
br i1 %18, label %13, label %19
19: ; preds = %13, %3
%20 = phi double [ %4, %3 ], [ %17, %13 ]
%21 = phi double [ %5, %3 ], [ %16, %13 ]
%22 = fadd double %20, -2.000000e+00
%23 = tail call i32 (double, double*, ...) bitcast (i32 (...)* @POLYNOM10 to i32 (double, double*, ...)*)(double %22, double* getelementptr inbounds ([11 x double], [11 x double]* @smallpos_gamma.p, i64 0, i64 0))
%24 = sitofp i32 %23 to double
%25 = fmul double %21, %24
%26 = tail call i32 (double, double*, ...) bitcast (i32 (...)* @POLYNOM8 to i32 (double, double*, ...)*)(double %22, double* getelementptr inbounds ([9 x double], [9 x double]* @smallpos_gamma.q, i64 0, i64 0))
%27 = sitofp i32 %26 to double
%28 = fdiv double %25, %27
ret double %28
}