int Rational_Extrapolation_to_Zero(double *fzero, double tableau[], double x[],
                                   double f, int n) {
  double t, up, across, denominator, dum;
  int col;
  if (n == 0) {
    *fzero = f;
    tableau[0] = f;
    return 0;
  }
  if (x[n] == 0.0) {
    *fzero = f;
    return -2;
  }
  across = 0.0;
  up = tableau[0];
  tableau[0] = f;
  for (col = 1; col <= n; col++) {
    denominator = tableau[col - 1] - across;
    if (denominator == 0.0)
      return -1;
    dum = 1.0 - (tableau[col - 1] - up) / denominator;
    denominator = (x[n - col] / x[n]) * dum - 1.0;
    if (denominator == 0.0)
      return -1;
    t = tableau[col - 1] + (tableau[col - 1] - up) / denominator;
    across = up;
    up = tableau[col];
    tableau[col] = t;
  }
  *fzero = t;
  return 0;
}


x86 assembly (clang, -O0):
<Rational_Extrapolation_to_Zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1148 <Rational_Extrapolation_to_Zero+0x48>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1307 <Rational_Extrapolation_to_Zero+0x207>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1181 <Rational_Extrapolation_to_Zero+0x81>
jp     1181 <Rational_Extrapolation_to_Zero+0x81>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0xfffffffe,-0x4(%rbp)
jmp    1307 <Rational_Extrapolation_to_Zero+0x207>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jg     12f3 <Rational_Extrapolation_to_Zero+0x1f3>
mov    -0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f6 <Rational_Extrapolation_to_Zero+0xf6>
jp     11f6 <Rational_Extrapolation_to_Zero+0xf6>
movl   $0xffffffff,-0x4(%rbp)
jmp    1307 <Rational_Extrapolation_to_Zero+0x207>
mov    -0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
subsd  -0x40(%rbp),%xmm1
divsd  -0x50(%rbp),%xmm1
movsd  0xdee(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdad(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1280 <Rational_Extrapolation_to_Zero+0x180>
jp     1280 <Rational_Extrapolation_to_Zero+0x180>
movl   $0xffffffff,-0x4(%rbp)
jmp    1307 <Rational_Extrapolation_to_Zero+0x207>
mov    -0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
subsd  -0x40(%rbp),%xmm1
divsd  -0x50(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    11aa <Rational_Extrapolation_to_Zero+0xaa>
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rational_Extrapolation_to_Zero>:
test   %ecx,%ecx
je     1123 <Rational_Extrapolation_to_Zero+0x23>
movslq %ecx,%r8
movsd  (%rdx,%r8,8),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    1130 <Rational_Extrapolation_to_Zero+0x30>
jp     1130 <Rational_Extrapolation_to_Zero+0x30>
movsd  %xmm0,(%rdi)
mov    $0xfffffffe,%eax
ret
movsd  %xmm0,(%rdi)
movsd  %xmm0,(%rsi)
jmp    11df <Rational_Extrapolation_to_Zero+0xdf>
movsd  (%rsi),%xmm1
movsd  %xmm0,(%rsi)
test   %ecx,%ecx
jle    11db <Rational_Extrapolation_to_Zero+0xdb>
add    $0x1,%ecx
lea    (%rdx,%r8,8),%r9
add    $0xfffffffffffffff8,%r9
xorpd  %xmm2,%xmm2
mov    $0x1,%r10d
movsd  0xea2(%rip),%xmm8
movsd  0xea2(%rip),%xmm4
xorpd  %xmm5,%xmm5
mov    $0xffffffff,%eax
nop
movapd %xmm0,%xmm6
subsd  %xmm5,%xmm6
ucomisd %xmm2,%xmm6
jne    1180 <Rational_Extrapolation_to_Zero+0x80>
jnp    11e1 <Rational_Extrapolation_to_Zero+0xe1>
movapd %xmm0,%xmm5
subsd  %xmm1,%xmm5
movapd %xmm5,%xmm7
divsd  %xmm6,%xmm7
movapd %xmm8,%xmm3
subsd  %xmm7,%xmm3
movsd  (%r9),%xmm6
divsd  (%rdx,%r8,8),%xmm6
mulsd  %xmm3,%xmm6
addsd  %xmm4,%xmm6
ucomisd %xmm2,%xmm6
jne    11b4 <Rational_Extrapolation_to_Zero+0xb4>
jnp    11e1 <Rational_Extrapolation_to_Zero+0xe1>
divsd  %xmm6,%xmm5
addsd  %xmm5,%xmm0
movapd %xmm1,%xmm5
movsd  (%rsi,%r10,8),%xmm1
movsd  %xmm0,(%rsi,%r10,8)
add    $0x1,%r10
add    $0xfffffffffffffff8,%r9
cmp    %r10,%rcx
jne    1170 <Rational_Extrapolation_to_Zero+0x70>
jmp    11db <Rational_Extrapolation_to_Zero+0xdb>
movsd  %xmm0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Rational_Extrapolation_to_Zero(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2, double %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %5
store double %3, double* %0
store double %3, double* %1
br label %47
8: ; preds = %5
%9 = sext i32 %4 to i64
%10 = getelementptr inbounds double, double* %2, i64 %9
%11 = load double, double* %10
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %8
store double %3, double* %0
br label %47
14: ; preds = %8
%15 = load double, double* %1
store double %3, double* %1
%16 = icmp slt i32 %4, 1
br i1 %16, label %45, label %17
17: ; preds = %14
%18 = add nuw i32 %4, 1
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %17, %38
%21 = phi double [ %3, %17 ], [ %40, %38 ]
%22 = phi i64 [ 1, %17 ], [ %43, %38 ]
%23 = phi double [ 0.000000e+00, %17 ], [ %24, %38 ]
%24 = phi double [ %15, %17 ], [ %42, %38 ]
%25 = fsub double %21, %23
%26 = fcmp oeq double %25, 0.000000e+00
br i1 %26, label %47, label %27
27: ; preds = %20
%28 = fsub double %21, %24
%29 = fdiv double %28, %25
%30 = fsub double 1.000000e+00, %29
%31 = sub nsw i64 %9, %22
%32 = getelementptr inbounds double, double* %2, i64 %31
%33 = load double, double* %32
%34 = load double, double* %10
%35 = fdiv double %33, %34
%36 = tail call double @llvm.fmuladd.f64(double %35, double %30, double -1.000000e+00)
%37 = fcmp oeq double %36, 0.000000e+00
br i1 %37, label %47, label %38
38: ; preds = %27
%39 = fdiv double %28, %36
%40 = fadd double %21, %39
%41 = getelementptr inbounds double, double* %1, i64 %22
%42 = load double, double* %41
store double %40, double* %41
%43 = add nuw nsw i64 %22, 1
%44 = icmp eq i64 %43, %19
br i1 %44, label %45, label %20
45: ; preds = %38, %14
%46 = phi double [ undef, %14 ], [ %40, %38 ]
store double %46, double* %0
br label %47
47: ; preds = %27, %20, %45, %13, %7
%48 = phi i32 [ 0, %7 ], [ -2, %13 ], [ 0, %45 ], [ -1, %20 ], [ -1, %27 ]
ret i32 %48
}