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++) {
    if (tableau[i] == 0 && old_aux == 0) {
      tableau[n] = 0.0;
      break;
    }
    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    1324 <Polynomial_Extrapolation_to_Zero+0x224>
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    1324 <Polynomial_Extrapolation_to_Zero+0x224>
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    1308 <Polynomial_Extrapolation_to_Zero+0x208>
mov    -0x18(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f6 <Polynomial_Extrapolation_to_Zero+0xf6>
jp     11f6 <Polynomial_Extrapolation_to_Zero+0xf6>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f6 <Polynomial_Extrapolation_to_Zero+0xf6>
jp     11f6 <Polynomial_Extrapolation_to_Zero+0xf6>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1308 <Polynomial_Extrapolation_to_Zero+0x208>
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    12a7 <Polynomial_Extrapolation_to_Zero+0x1a7>
jp     12a7 <Polynomial_Extrapolation_to_Zero+0x1a7>
movl   $0xffffffff,-0x4(%rbp)
jmp    1324 <Polynomial_Extrapolation_to_Zero+0x224>
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    11cd <Polynomial_Extrapolation_to_Zero+0xcd>
mov    %ecx,%r8d
add    $0xffffffff,%ecx
xorpd  %xmm2,%xmm2
xor    %r10d,%r10d
xorpd  %xmm6,%xmm6
nopl   0x0(%rax,%rax,1)
ucomisd %xmm2,%xmm0
jne    1160 <Polynomial_Extrapolation_to_Zero+0x60>
jp     1160 <Polynomial_Extrapolation_to_Zero+0x60>
ucomisd %xmm2,%xmm1
jne    1160 <Polynomial_Extrapolation_to_Zero+0x60>
jnp    11c5 <Polynomial_Extrapolation_to_Zero+0xc5>
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    1196 <Polynomial_Extrapolation_to_Zero+0x96>
jnp    11da <Polynomial_Extrapolation_to_Zero+0xda>
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>
jmp    11cd <Polynomial_Extrapolation_to_Zero+0xcd>
movq   $0x0,(%rsi,%r9,8)
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 %135
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 %135
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 = %125, %36
%44 = load i32, i32* %19
%45 = load i32, i32* %11
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %128
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 = fcmp oeq double %52, 0.000000e+00
br i1 %53, label %54, label %62
54: ; preds = %47
%55 = load double, double* %13
%56 = fcmp oeq double %55, 0.000000e+00
br i1 %56, label %57, label %62
57: ; preds = %54
%58 = load double*, double** %8
%59 = load i32, i32* %11
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %58, i64 %60
store double 0.000000e+00, double* %61
br label %128
62: ; preds = %54, %47
%63 = load double*, double** %8
%64 = load i32, i32* %19
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %63, i64 %65
%67 = load double, double* %66
%68 = load double, double* %13
%69 = fsub double %67, %68
store double %69, double* %15
%70 = load double*, double** %8
%71 = load i32, i32* %19
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
%74 = load double, double* %73
%75 = load double, double* %12
%76 = fsub double %74, %75
store double %76, double* %16
%77 = load double, double* %16
%78 = load double, double* %15
%79 = fsub double %77, %78
store double %79, double* %17
%80 = load double*, double** %9
%81 = load i32, i32* %11
%82 = load i32, i32* %19
%83 = sub nsw i32 %81, %82
%84 = sub nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %80, i64 %85
%87 = load double, double* %86
%88 = load double*, double** %9
%89 = load i32, i32* %11
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %88, i64 %90
%92 = load double, double* %91
%93 = fdiv double %87, %92
%94 = load double, double* %17
%95 = load double, double* %16
%96 = fneg double %95
%97 = call double @llvm.fmuladd.f64(double %93, double %94, double %96)
store double %97, double* %18
%98 = load double, double* %18
%99 = fcmp oeq double %98, 0.000000e+00
br i1 %99, label %100, label %101
100: ; preds = %62
store i32 -1, i32* %6
br label %135
101: ; preds = %62
%102 = load double, double* %13
store double %102, double* %12
%103 = load double*, double** %8
%104 = load i32, i32* %19
%105 = add nsw i32 %104, 1
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %103, i64 %106
%108 = load double, double* %107
store double %108, double* %13
%109 = load double*, double** %8
%110 = load i32, i32* %19
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %109, i64 %111
%113 = load double, double* %112
%114 = load double, double* %15
%115 = load double, double* %16
%116 = fmul double %114, %115
%117 = load double, double* %18
%118 = fdiv double %116, %117
%119 = fadd double %113, %118
%120 = load double*, double** %8
%121 = load i32, i32* %19
%122 = add nsw i32 %121, 1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %120, i64 %123
store double %119, double* %124
br label %125
125: ; preds = %101
%126 = load i32, i32* %19
%127 = add nsw i32 %126, 1
store i32 %127, i32* %19
br label %43
128: ; preds = %57, %43
%129 = load double*, double** %8
%130 = load i32, i32* %11
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double, double* %129, i64 %131
%133 = load double, double* %132
%134 = load double*, double** %7
store double %133, double* %134
store i32 0, i32* %6
br label %135
135: ; preds = %128, %100, %33, %22
%136 = load i32, i32* %6
ret i32 %136
}

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