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++) {
    if (tableau[col - 1] == 0 && across == 0) {
      t = 0;
      break;
    }
    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    1351 <Rational_Extrapolation_to_Zero+0x251>
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    1351 <Rational_Extrapolation_to_Zero+0x251>
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     133d <Rational_Extrapolation_to_Zero+0x23d>
mov    -0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1200 <Rational_Extrapolation_to_Zero+0x100>
jp     1200 <Rational_Extrapolation_to_Zero+0x100>
movsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1200 <Rational_Extrapolation_to_Zero+0x100>
jp     1200 <Rational_Extrapolation_to_Zero+0x100>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    133d <Rational_Extrapolation_to_Zero+0x23d>
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    1240 <Rational_Extrapolation_to_Zero+0x140>
jp     1240 <Rational_Extrapolation_to_Zero+0x140>
movl   $0xffffffff,-0x4(%rbp)
jmp    1351 <Rational_Extrapolation_to_Zero+0x251>
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  0xda4(%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  0xd63(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12ca <Rational_Extrapolation_to_Zero+0x1ca>
jp     12ca <Rational_Extrapolation_to_Zero+0x1ca>
movl   $0xffffffff,-0x4(%rbp)
jmp    1351 <Rational_Extrapolation_to_Zero+0x251>
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    11f5 <Rational_Extrapolation_to_Zero+0xf5>
movsd  (%rsi),%xmm1
movsd  %xmm0,(%rsi)
test   %ecx,%ecx
jle    11eb <Rational_Extrapolation_to_Zero+0xeb>
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
ucomisd %xmm2,%xmm0
jne    1180 <Rational_Extrapolation_to_Zero+0x80>
jp     1180 <Rational_Extrapolation_to_Zero+0x80>
ucomisd %xmm2,%xmm5
jne    1180 <Rational_Extrapolation_to_Zero+0x80>
jnp    11ed <Rational_Extrapolation_to_Zero+0xed>
movapd %xmm0,%xmm6
subsd  %xmm5,%xmm6
ucomisd %xmm2,%xmm6
jne    1190 <Rational_Extrapolation_to_Zero+0x90>
jnp    11f7 <Rational_Extrapolation_to_Zero+0xf7>
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    11c4 <Rational_Extrapolation_to_Zero+0xc4>
jnp    11f7 <Rational_Extrapolation_to_Zero+0xf7>
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    11f1 <Rational_Extrapolation_to_Zero+0xf1>
jmp    11f1 <Rational_Extrapolation_to_Zero+0xf1>
xorpd  %xmm0,%xmm0
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 %136
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 %136
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 = %130, %36
%44 = load i32, i32* %17
%45 = load i32, i32* %11
%46 = icmp sle i32 %44, %45
br i1 %46, label %47, label %133
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 = fcmp oeq double %53, 0.000000e+00
br i1 %54, label %55, label %59
55: ; preds = %47
%56 = load double, double* %14
%57 = fcmp oeq double %56, 0.000000e+00
br i1 %57, label %58, label %59
58: ; preds = %55
store double 0.000000e+00, double* %12
br label %133
59: ; preds = %55, %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* %14
%67 = fsub double %65, %66
store double %67, double* %15
%68 = load double, double* %15
%69 = fcmp oeq double %68, 0.000000e+00
br i1 %69, label %70, label %71
70: ; preds = %59
store i32 -1, i32* %6
br label %136
71: ; preds = %59
%72 = load double*, double** %8
%73 = load i32, i32* %17
%74 = sub nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %72, i64 %75
%77 = load double, double* %76
%78 = load double, double* %13
%79 = fsub double %77, %78
%80 = load double, double* %15
%81 = fdiv double %79, %80
%82 = fsub double 1.000000e+00, %81
store double %82, double* %16
%83 = load double*, double** %9
%84 = load i32, i32* %11
%85 = load i32, i32* %17
%86 = sub nsw i32 %84, %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %83, i64 %87
%89 = load double, double* %88
%90 = load double*, double** %9
%91 = load i32, i32* %11
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double, double* %90, i64 %92
%94 = load double, double* %93
%95 = fdiv double %89, %94
%96 = load double, double* %16
%97 = call double @llvm.fmuladd.f64(double %95, double %96, double -1.000000e+00)
store double %97, double* %15
%98 = load double, double* %15
%99 = fcmp oeq double %98, 0.000000e+00
br i1 %99, label %100, label %101
100: ; preds = %71
store i32 -1, i32* %6
br label %136
101: ; preds = %71
%102 = load double*, double** %8
%103 = load i32, i32* %17
%104 = sub nsw i32 %103, 1
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %102, i64 %105
%107 = load double, double* %106
%108 = load double*, double** %8
%109 = load i32, i32* %17
%110 = sub nsw i32 %109, 1
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %108, i64 %111
%113 = load double, double* %112
%114 = load double, double* %13
%115 = fsub double %113, %114
%116 = load double, double* %15
%117 = fdiv double %115, %116
%118 = fadd double %107, %117
store double %118, double* %12
%119 = load double, double* %13
store double %119, double* %14
%120 = load double*, double** %8
%121 = load i32, i32* %17
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %120, i64 %122
%124 = load double, double* %123
store double %124, double* %13
%125 = load double, double* %12
%126 = load double*, double** %8
%127 = load i32, i32* %17
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds double, double* %126, i64 %128
store double %125, double* %129
br label %130
130: ; preds = %101
%131 = load i32, i32* %17
%132 = add nsw i32 %131, 1
store i32 %132, i32* %17
br label %43
133: ; preds = %58, %43
%134 = load double, double* %12
%135 = load double*, double** %7
store double %134, double* %135
store i32 0, i32* %6
br label %136
136: ; preds = %133, %100, %70, %33, %20
%137 = load i32, i32* %6
ret i32 %137
}

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 %51
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 %51
14: ; preds = %8
%15 = load double, double* %1
store double %3, double* %1
%16 = icmp slt i32 %4, 1
br i1 %16, label %49, label %17
17: ; preds = %14
%18 = add nuw i32 %4, 1
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %17, %42
%21 = phi double [ %3, %17 ], [ %44, %42 ]
%22 = phi i64 [ 1, %17 ], [ %47, %42 ]
%23 = phi double [ 0.000000e+00, %17 ], [ %24, %42 ]
%24 = phi double [ %15, %17 ], [ %46, %42 ]
%25 = fcmp oeq double %21, 0.000000e+00
%26 = fcmp oeq double %23, 0.000000e+00
%27 = select i1 %25, i1 %26, i1 false
br i1 %27, label %49, label %28
28: ; preds = %20
%29 = fsub double %21, %23
%30 = fcmp oeq double %29, 0.000000e+00
br i1 %30, label %51, label %31
31: ; preds = %28
%32 = fsub double %21, %24
%33 = fdiv double %32, %29
%34 = fsub double 1.000000e+00, %33
%35 = sub nsw i64 %9, %22
%36 = getelementptr inbounds double, double* %2, i64 %35
%37 = load double, double* %36
%38 = load double, double* %10
%39 = fdiv double %37, %38
%40 = tail call double @llvm.fmuladd.f64(double %39, double %34, double -1.000000e+00)
%41 = fcmp oeq double %40, 0.000000e+00
br i1 %41, label %51, label %42
42: ; preds = %31
%43 = fdiv double %32, %40
%44 = fadd double %21, %43
%45 = getelementptr inbounds double, double* %1, i64 %22
%46 = load double, double* %45
store double %44, double* %45
%47 = add nuw nsw i64 %22, 1
%48 = icmp eq i64 %47, %19
br i1 %48, label %49, label %20
49: ; preds = %42, %20, %14
%50 = phi double [ undef, %14 ], [ 0.000000e+00, %20 ], [ %44, %42 ]
store double %50, double* %0
br label %51
51: ; preds = %31, %28, %49, %13, %7
%52 = phi i32 [ 0, %7 ], [ -2, %13 ], [ 0, %49 ], [ -1, %28 ], [ -1, %31 ]
ret i32 %52
}