int Polynomial_Extrapolation_to_Zero(double *fzero, double tableau[],
                                     double x[], double f, int n) {
  double back_two_columns;
  double old_aux;
  double new_value;
  double vertical_diff;
  double backslant_diff;
  double forwardslant_diff;
  double denominator;
  int i;
  if (n == 0) {
    tableau[0] = f;
    return 0;
  }
  if (x[n] == 0.0) {
    *fzero = f;
    return -2;
  }
  back_two_columns = 0.0;
  old_aux = tableau[0];
  tableau[0] = f;
  for (i = 0; i < n; i++) {
    vertical_diff = tableau[i] - old_aux;
    backslant_diff = tableau[i] - back_two_columns;
    forwardslant_diff = backslant_diff - vertical_diff;
    denominator = (x[n - i - 1] / x[n]) * forwardslant_diff - backslant_diff;
    if (denominator == 0.0)
      return -1;
    back_two_columns = old_aux;
    old_aux = tableau[i + 1];
    tableau[i + 1] = tableau[i] + vertical_diff * backslant_diff / denominator;
  }
  *fzero = tableau[n];
  return 0;
}


x86 assembly (clang, -O0):
<Polynomial_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    113b <Polynomial_Extrapolation_to_Zero+0x3b>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    12d7 <Polynomial_Extrapolation_to_Zero+0x1d7>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1174 <Polynomial_Extrapolation_to_Zero+0x74>
jp     1174 <Polynomial_Extrapolation_to_Zero+0x74>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0xfffffffe,-0x4(%rbp)
jmp    12d7 <Polynomial_Extrapolation_to_Zero+0x1d7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12bb <Polynomial_Extrapolation_to_Zero+0x1bb>
mov    -0x18(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    -0x6c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    125a <Polynomial_Extrapolation_to_Zero+0x15a>
jp     125a <Polynomial_Extrapolation_to_Zero+0x15a>
movl   $0xffffffff,-0x4(%rbp)
jmp    12d7 <Polynomial_Extrapolation_to_Zero+0x1d7>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x6c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
divsd  -0x68(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x6c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    119d <Polynomial_Extrapolation_to_Zero+0x9d>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Polynomial_Extrapolation_to_Zero>:
test   %ecx,%ecx
je     1123 <Polynomial_Extrapolation_to_Zero+0x23>
movslq %ecx,%r9
movsd  (%rdx,%r9,8),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    112a <Polynomial_Extrapolation_to_Zero+0x2a>
jp     112a <Polynomial_Extrapolation_to_Zero+0x2a>
movsd  %xmm0,(%rdi)
mov    $0xfffffffe,%eax
ret
movsd  %xmm0,(%rsi)
xor    %eax,%eax
ret
movsd  (%rsi),%xmm1
movsd  %xmm0,(%rsi)
test   %ecx,%ecx
jle    11b3 <Polynomial_Extrapolation_to_Zero+0xb3>
mov    %ecx,%r8d
add    $0xffffffff,%ecx
xorpd  %xmm2,%xmm2
xor    %r10d,%r10d
xorpd  %xmm6,%xmm6
nopw   0x0(%rax,%rax,1)
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
movapd %xmm0,%xmm4
subsd  %xmm6,%xmm4
movapd %xmm4,%xmm6
subsd  %xmm3,%xmm6
movslq %ecx,%rax
movsd  (%rdx,%rax,8),%xmm5
divsd  (%rdx,%r9,8),%xmm5
mulsd  %xmm6,%xmm5
subsd  %xmm4,%xmm5
ucomisd %xmm2,%xmm5
jne    1186 <Polynomial_Extrapolation_to_Zero+0x86>
jnp    11c0 <Polynomial_Extrapolation_to_Zero+0xc0>
movapd %xmm1,%xmm6
movsd  0x8(%rsi,%r10,8),%xmm1
mulsd  %xmm4,%xmm3
divsd  %xmm5,%xmm3
addsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%rsi,%r10,8)
lea    0x1(%r10),%rax
add    $0xffffffff,%ecx
mov    %rax,%r10
cmp    %rax,%r8
jne    1150 <Polynomial_Extrapolation_to_Zero+0x50>
movsd  (%rsi,%r9,8),%xmm0
movsd  %xmm0,(%rdi)
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @Polynomial_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 double
%18 = alloca double
%19 = 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
%20 = load i32, i32* %11
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %5
%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 %120
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 %120
36: ; preds = %26
store double 0.000000e+00, double* %12
%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 0, i32* %19
br label %43
43: ; preds = %110, %36
%44 = load i32, i32* %19
%45 = load i32, i32* %11
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %113
47: ; preds = %43
%48 = load double*, double** %8
%49 = load i32, i32* %19
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
%52 = load double, double* %51
%53 = load double, double* %13
%54 = fsub double %52, %53
store double %54, double* %15
%55 = load double*, double** %8
%56 = load i32, i32* %19
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
%59 = load double, double* %58
%60 = load double, double* %12
%61 = fsub double %59, %60
store double %61, double* %16
%62 = load double, double* %16
%63 = load double, double* %15
%64 = fsub double %62, %63
store double %64, double* %17
%65 = load double*, double** %9
%66 = load i32, i32* %11
%67 = load i32, i32* %19
%68 = sub nsw i32 %66, %67
%69 = sub nsw i32 %68, 1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %65, i64 %70
%72 = load double, double* %71
%73 = load double*, double** %9
%74 = load i32, i32* %11
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %73, i64 %75
%77 = load double, double* %76
%78 = fdiv double %72, %77
%79 = load double, double* %17
%80 = load double, double* %16
%81 = fneg double %80
%82 = call double @llvm.fmuladd.f64(double %78, double %79, double %81)
store double %82, double* %18
%83 = load double, double* %18
%84 = fcmp oeq double %83, 0.000000e+00
br i1 %84, label %85, label %86
85: ; preds = %47
store i32 -1, i32* %6
br label %120
86: ; preds = %47
%87 = load double, double* %13
store double %87, double* %12
%88 = load double*, double** %8
%89 = load i32, i32* %19
%90 = add nsw i32 %89, 1
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %88, i64 %91
%93 = load double, double* %92
store double %93, double* %13
%94 = load double*, double** %8
%95 = load i32, i32* %19
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
%98 = load double, double* %97
%99 = load double, double* %15
%100 = load double, double* %16
%101 = fmul double %99, %100
%102 = load double, double* %18
%103 = fdiv double %101, %102
%104 = fadd double %98, %103
%105 = load double*, double** %8
%106 = load i32, i32* %19
%107 = add nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %105, i64 %108
store double %104, double* %109
br label %110
110: ; preds = %86
%111 = load i32, i32* %19
%112 = add nsw i32 %111, 1
store i32 %112, i32* %19
br label %43
113: ; preds = %43
%114 = load double*, double** %8
%115 = load i32, i32* %11
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds double, double* %114, i64 %116
%118 = load double, double* %117
%119 = load double*, double** %7
store double %118, double* %119
store i32 0, i32* %6
br label %120
120: ; preds = %113, %85, %33, %22
%121 = load i32, i32* %6
ret i32 %121
}

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