double Px(double **matriz, double x) {
  return (matriz[0][1] + matriz[0][2] * (x - matriz[0][0]) +
          matriz[0][3] * (x - matriz[1][0]) * (x - matriz[0][0]) +
          matriz[0][4] * (x - matriz[0][0]) * (x - matriz[1][0]) *
              (x - matriz[2][0]));
}


x86 assembly (clang, -O0):
<Px>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x18(%rax),%xmm1
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsd  0x20(%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Px>:
mov    (%rdi),%rax
mov    0x8(%rdi),%rcx
movapd %xmm0,%xmm1
subsd  (%rax),%xmm1
movsd  0x10(%rax),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x8(%rax),%xmm2
movapd %xmm0,%xmm3
subsd  (%rcx),%xmm3
movsd  0x18(%rax),%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm2,%xmm4
mulsd  0x20(%rax),%xmm1
mulsd  %xmm3,%xmm1
mov    0x10(%rdi),%rax
subsd  (%rax),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @Px(double** %0, double %1) {
%3 = alloca double**
%4 = alloca double
store double** %0, double*** %3
store double %1, double* %4
%5 = load double**, double*** %3
%6 = getelementptr inbounds double*, double** %5, i64 0
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 1
%9 = load double, double* %8
%10 = load double**, double*** %3
%11 = getelementptr inbounds double*, double** %10, i64 0
%12 = load double*, double** %11
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = load double, double* %4
%16 = load double**, double*** %3
%17 = getelementptr inbounds double*, double** %16, i64 0
%18 = load double*, double** %17
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = fsub double %15, %20
%22 = call double @llvm.fmuladd.f64(double %14, double %21, double %9)
%23 = load double**, double*** %3
%24 = getelementptr inbounds double*, double** %23, i64 0
%25 = load double*, double** %24
%26 = getelementptr inbounds double, double* %25, i64 3
%27 = load double, double* %26
%28 = load double, double* %4
%29 = load double**, double*** %3
%30 = getelementptr inbounds double*, double** %29, i64 1
%31 = load double*, double** %30
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = fsub double %28, %33
%35 = fmul double %27, %34
%36 = load double, double* %4
%37 = load double**, double*** %3
%38 = getelementptr inbounds double*, double** %37, i64 0
%39 = load double*, double** %38
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double, double* %40
%42 = fsub double %36, %41
%43 = call double @llvm.fmuladd.f64(double %35, double %42, double %22)
%44 = load double**, double*** %3
%45 = getelementptr inbounds double*, double** %44, i64 0
%46 = load double*, double** %45
%47 = getelementptr inbounds double, double* %46, i64 4
%48 = load double, double* %47
%49 = load double, double* %4
%50 = load double**, double*** %3
%51 = getelementptr inbounds double*, double** %50, i64 0
%52 = load double*, double** %51
%53 = getelementptr inbounds double, double* %52, i64 0
%54 = load double, double* %53
%55 = fsub double %49, %54
%56 = fmul double %48, %55
%57 = load double, double* %4
%58 = load double**, double*** %3
%59 = getelementptr inbounds double*, double** %58, i64 1
%60 = load double*, double** %59
%61 = getelementptr inbounds double, double* %60, i64 0
%62 = load double, double* %61
%63 = fsub double %57, %62
%64 = fmul double %56, %63
%65 = load double, double* %4
%66 = load double**, double*** %3
%67 = getelementptr inbounds double*, double** %66, i64 2
%68 = load double*, double** %67
%69 = getelementptr inbounds double, double* %68, i64 0
%70 = load double, double* %69
%71 = fsub double %65, %70
%72 = call double @llvm.fmuladd.f64(double %64, double %71, double %43)
ret double %72
}

LLVM IR (-O2):
define double @Px(double** nocapture %0, double %1) {
%3 = load double*, double** %0
%4 = getelementptr inbounds double, double* %3, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %3, i64 2
%7 = load double, double* %6
%8 = load double, double* %3
%9 = fsub double %1, %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %5)
%11 = getelementptr inbounds double, double* %3, i64 3
%12 = load double, double* %11
%13 = getelementptr inbounds double*, double** %0, i64 1
%14 = load double*, double** %13
%15 = load double, double* %14
%16 = fsub double %1, %15
%17 = fmul double %12, %16
%18 = tail call double @llvm.fmuladd.f64(double %17, double %9, double %10)
%19 = getelementptr inbounds double, double* %3, i64 4
%20 = load double, double* %19
%21 = fmul double %9, %20
%22 = fmul double %16, %21
%23 = getelementptr inbounds double*, double** %0, i64 2
%24 = load double*, double** %23
%25 = load double, double* %24
%26 = fsub double %1, %25
%27 = tail call double @llvm.fmuladd.f64(double %22, double %26, double %18)
ret double %27
}