double confrac(a, b, x)
double a, b, x;
{
  double Alo = 0.0;
  double Ahi;
  double Aev;
  double Aod;
  double Blo = 1.0;
  double Bhi = 1.0;
  double Bod = 1.0;
  double Bev = 1.0;
  double f;
  double fold;
  double Apb = a + b;
  double d;
  int i;
  int j;
  Ahi = exp(lngamma((Apb)) + a * log(x) + b * log(1.0 - x) -
            lngamma((a + 1.0)) - lngamma((b)));
  for (i = 0, j = 1, f = Ahi; i <= 200; i++, j++) {
    d = a + j + i;
    Aev = -(a + i) * (Apb + i) * x / d / (d - 1.0);
    Aod = j * (b - j) * x / d / (d + 1.0);
    Alo = Bev * Ahi + Aev * Alo;
    Blo = Bev * Bhi + Aev * Blo;
    Ahi = Bod * Alo + Aod * Ahi;
    Bhi = Bod * Blo + Aod * Bhi;
    if (fabs(Bhi) < 1.0E-08)
      Bhi = 0.0;
    if (Bhi != 0.0) {
      fold = f;
      f = Ahi / Bhi;
      if (fabs(f - fold) < fabs(f) * 1.0E-08)
        return f;
    }
  }
  return -1.0;
}


x86 assembly (clang, -O0):
<confrac>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe7f(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
mov    $0x1,%al
call   1040 <lngamma@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1050 <log@plt>
movsd  -0xb8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xe04(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1050 <log@plt>
movsd  -0xa8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xdcf(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1040 <lngamma@plt>
movsd  -0x98(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1040 <lngamma@plt>
movsd  -0x90(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x1,-0x88(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
cmpl   $0xc8,-0x84(%rbp)
jg     14c4 <confrac+0x394>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x88(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
cvtsi2sdl -0x84(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x84(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x78(%rbp),%xmm1
cvtsi2sdl -0x84(%rbp),%xmm2
ff
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  0xce1(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0x88(%rbp),%xmm0
ff
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x88(%rbp),%xmm2
ff
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  0xca5(%rip),%xmm1
addsd  -0x80(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movaps 0xc27(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xc0b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1417 <confrac+0x2e7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1434 <confrac+0x304>
jp     1434 <confrac+0x304>
jmp    149c <confrac+0x36c>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm1
subsd  -0x70(%rbp),%xmm1
movaps 0xbc2(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
movaps 0xbb2(%rip),%xmm2
pand   %xmm2,%xmm0
movsd  0xb96(%rip),%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1497 <confrac+0x367>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    14d1 <confrac+0x3a1>
jmp    149c <confrac+0x36c>
jmp    14a1 <confrac+0x371>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1299 <confrac+0x169>
movsd  0xb3c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confrac>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
mov    $0x1,%al
call   1040 <lngamma@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <log@plt>
mulsd  0x10(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe7a(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
call   1050 <log@plt>
mulsd  0x18(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xe51(%rip),%xmm0
mov    $0x1,%al
call   1040 <lngamma@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1040 <lngamma@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm15
mov    $0x1,%eax
movsd  0xe06(%rip),%xmm11
movapd 0xe25(%rip),%xmm10
movsd  0xdfc(%rip),%xmm13
movapd 0xe13(%rip),%xmm12
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm14
movsd  0xdd2(%rip),%xmm5
movapd %xmm5,%xmm4
movapd %xmm5,%xmm9
movsd  0x10(%rsp),%xmm8
jmp    1250 <confrac+0x120>
lea    0x2(%rax),%ecx
cmp    $0xc8,%eax
mov    %ecx,%eax
je     1333 <confrac+0x203>
xorps  %xmm7,%xmm7
cvtsi2sd %eax,%xmm7
movsd  0x18(%rsp),%xmm1
subsd  %xmm7,%xmm1
mulsd  %xmm7,%xmm1
addsd  %xmm8,%xmm7
add    $0xffffffff,%eax
xorps  %xmm6,%xmm6
cvtsi2sd %eax,%xmm6
addsd  %xmm6,%xmm7
movsd  0x20(%rsp),%xmm3
addsd  %xmm6,%xmm3
addsd  %xmm8,%xmm6
xorpd  0xd91(%rip),%xmm6
mulsd  %xmm3,%xmm6
mulsd  %xmm15,%xmm6
divsd  %xmm7,%xmm6
movapd %xmm7,%xmm3
addsd  %xmm11,%xmm3
divsd  %xmm3,%xmm6
mulsd  %xmm15,%xmm1
divsd  %xmm7,%xmm1
addsd  %xmm9,%xmm7
divsd  %xmm7,%xmm1
mulsd  %xmm6,%xmm2
mulsd  %xmm6,%xmm4
addsd  %xmm0,%xmm2
addsd  %xmm5,%xmm4
mulsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm1
addsd  %xmm4,%xmm1
movapd %xmm1,%xmm5
andpd  %xmm10,%xmm5
cmpltsd %xmm13,%xmm5
andnpd %xmm1,%xmm5
addsd  %xmm2,%xmm0
ucomisd 0xd22(%rip),%xmm5
jne    12fe <confrac+0x1ce>
jnp    1240 <confrac+0x110>
movapd %xmm0,%xmm1
divsd  %xmm5,%xmm1
movapd %xmm1,%xmm3
subsd  %xmm14,%xmm3
andpd  %xmm12,%xmm3
movapd %xmm1,%xmm6
andpd  %xmm12,%xmm6
mulsd  %xmm13,%xmm6
ucomisd %xmm3,%xmm6
movapd %xmm1,%xmm14
jbe    1240 <confrac+0x110>
jmp    1338 <confrac+0x208>
movapd %xmm11,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @confrac(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca i32
%21 = alloca i32
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double 0.000000e+00, double* %8
store double 1.000000e+00, double* %12
store double 1.000000e+00, double* %13
store double 1.000000e+00, double* %14
store double 1.000000e+00, double* %15
%22 = load double, double* %5
%23 = load double, double* %6
%24 = fadd double %22, %23
store double %24, double* %18
%25 = load double, double* %18
%26 = call i32 (double, ...) bitcast (i32 (...)* @lngamma to i32 (double, ...)*)(double %25)
%27 = sitofp i32 %26 to double
%28 = load double, double* %5
%29 = load double, double* %7
%30 = call double @log(double %29)
%31 = call double @llvm.fmuladd.f64(double %28, double %30, double %27)
%32 = load double, double* %6
%33 = load double, double* %7
%34 = fsub double 1.000000e+00, %33
%35 = call double @log(double %34)
%36 = call double @llvm.fmuladd.f64(double %32, double %35, double %31)
%37 = load double, double* %5
%38 = fadd double %37, 1.000000e+00
%39 = call i32 (double, ...) bitcast (i32 (...)* @lngamma to i32 (double, ...)*)(double %38)
%40 = sitofp i32 %39 to double
%41 = fsub double %36, %40
%42 = load double, double* %6
%43 = call i32 (double, ...) bitcast (i32 (...)* @lngamma to i32 (double, ...)*)(double %42)
%44 = sitofp i32 %43 to double
%45 = fsub double %41, %44
%46 = call double @exp(double %45)
store double %46, double* %9
store i32 0, i32* %20
store i32 1, i32* %21
%47 = load double, double* %9
store double %47, double* %16
br label %48
48: ; preds = %138, %3
%49 = load i32, i32* %20
%50 = icmp sle i32 %49, 200
br i1 %50, label %51, label %143
51: ; preds = %48
%52 = load double, double* %5
%53 = load i32, i32* %21
%54 = sitofp i32 %53 to double
%55 = fadd double %52, %54
%56 = load i32, i32* %20
%57 = sitofp i32 %56 to double
%58 = fadd double %55, %57
store double %58, double* %19
%59 = load double, double* %5
%60 = load i32, i32* %20
%61 = sitofp i32 %60 to double
%62 = fadd double %59, %61
%63 = fneg double %62
%64 = load double, double* %18
%65 = load i32, i32* %20
%66 = sitofp i32 %65 to double
%67 = fadd double %64, %66
%68 = fmul double %63, %67
%69 = load double, double* %7
%70 = fmul double %68, %69
%71 = load double, double* %19
%72 = fdiv double %70, %71
%73 = load double, double* %19
%74 = fsub double %73, 1.000000e+00
%75 = fdiv double %72, %74
store double %75, double* %10
%76 = load i32, i32* %21
%77 = sitofp i32 %76 to double
%78 = load double, double* %6
%79 = load i32, i32* %21
%80 = sitofp i32 %79 to double
%81 = fsub double %78, %80
%82 = fmul double %77, %81
%83 = load double, double* %7
%84 = fmul double %82, %83
%85 = load double, double* %19
%86 = fdiv double %84, %85
%87 = load double, double* %19
%88 = fadd double %87, 1.000000e+00
%89 = fdiv double %86, %88
store double %89, double* %11
%90 = load double, double* %15
%91 = load double, double* %9
%92 = load double, double* %10
%93 = load double, double* %8
%94 = fmul double %92, %93
%95 = call double @llvm.fmuladd.f64(double %90, double %91, double %94)
store double %95, double* %8
%96 = load double, double* %15
%97 = load double, double* %13
%98 = load double, double* %10
%99 = load double, double* %12
%100 = fmul double %98, %99
%101 = call double @llvm.fmuladd.f64(double %96, double %97, double %100)
store double %101, double* %12
%102 = load double, double* %14
%103 = load double, double* %8
%104 = load double, double* %11
%105 = load double, double* %9
%106 = fmul double %104, %105
%107 = call double @llvm.fmuladd.f64(double %102, double %103, double %106)
store double %107, double* %9
%108 = load double, double* %14
%109 = load double, double* %12
%110 = load double, double* %11
%111 = load double, double* %13
%112 = fmul double %110, %111
%113 = call double @llvm.fmuladd.f64(double %108, double %109, double %112)
store double %113, double* %13
%114 = load double, double* %13
%115 = call double @llvm.fabs.f64(double %114)
%116 = fcmp olt double %115, 1.000000e-08
br i1 %116, label %117, label %118
117: ; preds = %51
store double 0.000000e+00, double* %13
br label %118
118: ; preds = %117, %51
%119 = load double, double* %13
%120 = fcmp une double %119, 0.000000e+00
br i1 %120, label %121, label %137
121: ; preds = %118
%122 = load double, double* %16
store double %122, double* %17
%123 = load double, double* %9
%124 = load double, double* %13
%125 = fdiv double %123, %124
store double %125, double* %16
%126 = load double, double* %16
%127 = load double, double* %17
%128 = fsub double %126, %127
%129 = call double @llvm.fabs.f64(double %128)
%130 = load double, double* %16
%131 = call double @llvm.fabs.f64(double %130)
%132 = fmul double %131, 1.000000e-08
%133 = fcmp olt double %129, %132
br i1 %133, label %134, label %136
134: ; preds = %121
%135 = load double, double* %16
store double %135, double* %4
br label %144
136: ; preds = %121
br label %137
137: ; preds = %136, %118
br label %138
138: ; preds = %137
%139 = load i32, i32* %20
%140 = add nsw i32 %139, 1
store i32 %140, i32* %20
%141 = load i32, i32* %21
%142 = add nsw i32 %141, 1
store i32 %142, i32* %21
br label %48
143: ; preds = %48
store double -1.000000e+00, double* %4
br label %144
144: ; preds = %143, %134
%145 = load double, double* %4
ret double %145
}

LLVM IR (-O2):
define double @confrac(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @lngamma to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
%7 = tail call double @log(double %2)
%8 = tail call double @llvm.fmuladd.f64(double %0, double %7, double %6)
%9 = fsub double 1.000000e+00, %2
%10 = tail call double @log(double %9)
%11 = tail call double @llvm.fmuladd.f64(double %1, double %10, double %8)
%12 = fadd double %0, 1.000000e+00
%13 = tail call i32 (double, ...) bitcast (i32 (...)* @lngamma to i32 (double, ...)*)(double %12)
%14 = sitofp i32 %13 to double
%15 = fsub double %11, %14
%16 = tail call i32 (double, ...) bitcast (i32 (...)* @lngamma to i32 (double, ...)*)(double %1)
%17 = sitofp i32 %16 to double
%18 = fsub double %15, %17
%19 = tail call double @exp(double %18)
br label %20
20: ; preds = %3, %65
%21 = phi i32 [ 1, %3 ], [ %68, %65 ]
%22 = phi i32 [ 0, %3 ], [ %67, %65 ]
%23 = phi double [ 0.000000e+00, %3 ], [ %47, %65 ]
%24 = phi double [ %19, %3 ], [ %51, %65 ]
%25 = phi double [ %19, %3 ], [ %66, %65 ]
%26 = phi double [ 1.000000e+00, %3 ], [ %49, %65 ]
%27 = phi double [ 1.000000e+00, %3 ], [ %56, %65 ]
%28 = sitofp i32 %21 to double
%29 = fadd double %28, %0
%30 = sitofp i32 %22 to double
%31 = fadd double %29, %30
%32 = fadd double %30, %0
%33 = fneg double %32
%34 = fadd double %4, %30
%35 = fmul double %34, %33
%36 = fmul double %35, %2
%37 = fdiv double %36, %31
%38 = fadd double %31, -1.000000e+00
%39 = fdiv double %37, %38
%40 = fsub double %1, %28
%41 = fmul double %40, %28
%42 = fmul double %41, %2
%43 = fdiv double %42, %31
%44 = fadd double %31, 1.000000e+00
%45 = fdiv double %43, %44
%46 = fmul double %23, %39
%47 = fadd double %24, %46
%48 = fmul double %26, %39
%49 = fadd double %27, %48
%50 = fmul double %24, %45
%51 = fadd double %47, %50
%52 = fmul double %27, %45
%53 = fadd double %49, %52
%54 = tail call double @llvm.fabs.f64(double %53)
%55 = fcmp olt double %54, 1.000000e-08
%56 = select i1 %55, double 0.000000e+00, double %53
%57 = fcmp une double %56, 0.000000e+00
br i1 %57, label %58, label %65
58: ; preds = %20
%59 = fdiv double %51, %56
%60 = fsub double %59, %25
%61 = tail call double @llvm.fabs.f64(double %60)
%62 = tail call double @llvm.fabs.f64(double %59)
%63 = fmul double %62, 1.000000e-08
%64 = fcmp olt double %61, %63
br i1 %64, label %70, label %65
65: ; preds = %20, %58
%66 = phi double [ %59, %58 ], [ %25, %20 ]
%67 = add nuw nsw i32 %22, 1
%68 = add nuw nsw i32 %21, 1
%69 = icmp eq i32 %67, 201
br i1 %69, label %70, label %20
70: ; preds = %65, %58
%71 = phi double [ %59, %58 ], [ -1.000000e+00, %65 ]
ret double %71
}