float gammln(float xx) {
  double x, y, tmp, ser;
  static double cof[6] = {76.18, -86.50, 24.01, -1.23, 0.12, -0.53};
  int j;
  y = x = xx;
  tmp = x + 5.5;
  tmp -= (x + 0.5) * tmp / 231;
  ser = 1.000000000190015;
  for (j = 0; j <= 5; j++)
    ser += cof[j] / ++y;
  return -tmp + ((2.5066282746310005 * ser / x) / 231);
}


x86 assembly (clang, -O0):
<gammln>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  0xef4(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeda(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  0xec0(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe9e(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jg     11b6 <gammln+0xb6>
movslq -0x2c(%rbp),%rcx
lea    0x2ead(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe98(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  %xmm1,-0x18(%rbp)
divsd  %xmm1,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    116e <gammln+0x6e>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe46(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  -0x10(%rbp),%xmm1
movsd  0xe1c(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammln>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
movaps %xmm0,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm3
addsd  %xmm1,%xmm3
unpcklpd %xmm3,%xmm2
movapd 0xf09(%rip),%xmm4
divpd  %xmm2,%xmm4
movsd  0xed5(%rip),%xmm2
addsd  %xmm4,%xmm2
unpckhpd %xmm4,%xmm4
addsd  %xmm2,%xmm4
addsd  %xmm1,%xmm3
movapd %xmm3,%xmm2
addsd  %xmm1,%xmm2
unpcklpd %xmm2,%xmm3
movapd 0xee9(%rip),%xmm5
divpd  %xmm3,%xmm5
addsd  %xmm5,%xmm4
unpckhpd %xmm5,%xmm5
addsd  %xmm4,%xmm5
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm1
unpcklpd %xmm1,%xmm2
movapd 0xed5(%rip),%xmm1
divpd  %xmm2,%xmm1
addsd  %xmm1,%xmm5
unpckhpd %xmm1,%xmm1
addsd  %xmm5,%xmm1
movsd  0xe7d(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  0xe79(%rip),%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
movsd  0xe71(%rip),%xmm4
divsd  %xmm4,%xmm3
subsd  %xmm3,%xmm2
mulsd  0xe69(%rip),%xmm1
divsd  %xmm0,%xmm1
divsd  %xmm4,%xmm1
subsd  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
@gammln.cof = internal global [6 x double] [double 7.618000e+01, double -8.650000e+01, double 2.401000e+01, double -1.230000e+00, double 1.200000e-01, double -5.300000e-01]
define float @gammln(float %0) {
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store float %0, float* %2
%8 = load float, float* %2
%9 = fpext float %8 to double
store double %9, double* %3
store double %9, double* %4
%10 = load double, double* %3
%11 = fadd double %10, 5.500000e+00
store double %11, double* %5
%12 = load double, double* %3
%13 = fadd double %12, 5.000000e-01
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = fdiv double %15, 2.310000e+02
%17 = load double, double* %5
%18 = fsub double %17, %16
store double %18, double* %5
store double 0x3FF00000000D0EC7, double* %6
store i32 0, i32* %7
br label %19
19: ; preds = %32, %1
%20 = load i32, i32* %7
%21 = icmp sle i32 %20, 5
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [6 x double], [6 x double]* @gammln.cof, i64 0, i64 %24
%26 = load double, double* %25
%27 = load double, double* %4
%28 = fadd double %27, 1.000000e+00
store double %28, double* %4
%29 = fdiv double %26, %28
%30 = load double, double* %6
%31 = fadd double %30, %29
store double %31, double* %6
br label %32
32: ; preds = %22
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %19
35: ; preds = %19
%36 = load double, double* %5
%37 = fneg double %36
%38 = load double, double* %6
%39 = fmul double 0x40040D931FF62706, %38
%40 = load double, double* %3
%41 = fdiv double %39, %40
%42 = fdiv double %41, 2.310000e+02
%43 = fadd double %37, %42
%44 = fptrunc double %43 to float
ret float %44
}

LLVM IR (-O2):
define float @gammln(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 1.000000e+00
%4 = fadd double %3, 1.000000e+00
%5 = insertelement <2 x double> poison, double %3, i64 0
%6 = insertelement <2 x double> %5, double %4, i64 1
%7 = fdiv <2 x double> <double 7.618000e+01, double -8.650000e+01>, %6
%8 = extractelement <2 x double> %7, i64 0
%9 = fadd double %8, 0x3FF00000000D0EC7
%10 = extractelement <2 x double> %7, i64 1
%11 = fadd double %9, %10
%12 = fadd double %4, 1.000000e+00
%13 = fadd double %12, 1.000000e+00
%14 = insertelement <2 x double> poison, double %12, i64 0
%15 = insertelement <2 x double> %14, double %13, i64 1
%16 = fdiv <2 x double> <double 2.401000e+01, double -1.230000e+00>, %15
%17 = extractelement <2 x double> %16, i64 0
%18 = fadd double %11, %17
%19 = extractelement <2 x double> %16, i64 1
%20 = fadd double %18, %19
%21 = fadd double %13, 1.000000e+00
%22 = fadd double %21, 1.000000e+00
%23 = insertelement <2 x double> poison, double %21, i64 0
%24 = insertelement <2 x double> %23, double %22, i64 1
%25 = fdiv <2 x double> <double 1.200000e-01, double -5.300000e-01>, %24
%26 = extractelement <2 x double> %25, i64 0
%27 = fadd double %20, %26
%28 = extractelement <2 x double> %25, i64 1
%29 = fadd double %27, %28
%30 = fadd double %2, 5.500000e+00
%31 = fadd double %2, 5.000000e-01
%32 = fmul double %31, %30
%33 = fdiv double %32, 2.310000e+02
%34 = fsub double %30, %33
%35 = fmul double %29, 0x40040D931FF62706
%36 = fdiv double %35, %2
%37 = fdiv double %36, 2.310000e+02
%38 = fsub double %37, %34
%39 = fptrunc double %38 to float
ret float %39
}