int main() {
  double **matriz;
  double x = 0.91;
  double a = -1;
  double b = 1;
  double sol;
  int npartes;
  int FIL;
  int COL;
  int j;
  double i;
  npartes = 10;
  FIL = npartes + 1;
  COL = npartes + 2;
  matriz = (double **)malloc(FIL * sizeof(double *));
  for (j = 0; j < COL; j++)
    matriz[j] = (double *)malloc(COL * sizeof(double));
  iniMatriz(matriz, a, b, npartes, FIL, COL);
  printf("\n\n");
  for (i = a; i < b + 0.01; i += 0.01)
    printf("%lf %lf \n", i, (10 * fabs(i)));
  printf("\n\n");
  f1(matriz, FIL, COL);
  for (i = a; i < b + 0.01; i += 0.01) {
    sol = Px(matriz, i, FIL, COL);
    printf("%lf %lf \n", i, sol);
  }
  for (j = 0; j < FIL; j++)
    free(matriz[j]);
  free(matriz);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe84(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0xa,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x3c(%rbp)
movslq -0x38(%rbp),%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    11fd <main+0x9d>
movslq -0x3c(%rbp),%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11c7 <main+0x67>
mov    -0x10(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    $0x2,%al
call   1060 <iniMatriz@plt>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  0xdd8(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1295 <main+0x135>
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movaps 0xdd0(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xdb4(%rip),%xmm1
mulsd  %xmm2,%xmm1
lea    0xdcc(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xd92(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1233 <main+0xd3>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    $0x0,%al
call   1070 <f1@plt>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  0xd4d(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1328 <main+0x1c8>
mov    -0x10(%rbp),%rdi
movsd  -0x48(%rbp),%xmm0
mov    -0x38(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    $0x1,%al
call   1050 <Px@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xd39(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xcff(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    12be <main+0x15e>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    135a <main+0x1fa>
mov    -0x10(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    132f <main+0x1cf>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    $0x58,%edi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x8(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x10(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x18(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x20(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x28(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x30(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x38(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x40(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x48(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x50(%r14)
mov    $0x60,%edi
call   1090 <malloc@plt>
mov    %rax,0x58(%r14)
movsd  0xdcd(%rip),%xmm0
movsd  0xdcd(%rip),%xmm1
mov    %r14,%rdi
movapd %xmm0,(%rsp)
mov    $0xa,%esi
mov    $0xb,%edx
mov    $0xc,%ecx
mov    $0x2,%al
call   1070 <iniMatriz@plt>
lea    0xde8(%rip),%rdi
call   1040 <puts@plt>
lea    0xdd4(%rip),%rbx
nopl   0x0(%rax)
movapd (%rsp),%xmm0
movapd %xmm0,%xmm1
andpd  0xdaf(%rip),%xmm1
mulsd  0xd87(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movapd (%rsp),%xmm1
addsd  0xd78(%rip),%xmm1
movsd  0xd78(%rip),%xmm0
movapd %xmm1,(%rsp)
ucomisd %xmm1,%xmm0
ja     1270 <main+0x100>
lea    0xd8e(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    $0xb,%esi
mov    $0xc,%edx
xor    %eax,%eax
call   1080 <f1@plt>
movsd  0xd25(%rip),%xmm0
lea    0xd5e(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
movsd  (%rsp),%xmm0
mov    $0xb,%esi
mov    $0xc,%edx
mov    $0x1,%al
call   1060 <Px@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
mov    $0x2,%al
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xce7(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xce2(%rip),%xmm0
ucomisd (%rsp),%xmm0
movsd  (%rsp),%xmm0
ja     12f0 <main+0x180>
mov    (%r14),%rdi
call   1030 <free@plt>
mov    0x8(%r14),%rdi
call   1030 <free@plt>
mov    0x10(%r14),%rdi
call   1030 <free@plt>
mov    0x18(%r14),%rdi
call   1030 <free@plt>
mov    0x20(%r14),%rdi
call   1030 <free@plt>
mov    0x28(%r14),%rdi
call   1030 <free@plt>
mov    0x30(%r14),%rdi
call   1030 <free@plt>
mov    0x38(%r14),%rdi
call   1030 <free@plt>
mov    0x40(%r14),%rdi
call   1030 <free@plt>
mov    0x48(%r14),%rdi
call   1030 <free@plt>
mov    0x50(%r14),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [10 x i8] c"%lf %lf \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double**
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32 0, i32* %1
store double 9.100000e-01, double* %3
store double -1.000000e+00, double* %4
store double 1.000000e+00, double* %5
store i32 10, i32* %7
%12 = load i32, i32* %7
%13 = add nsw i32 %12, 1
store i32 %13, i32* %8
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 2
store i32 %15, i32* %9
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = mul i64 %17, 8
%19 = call i8* @malloc(i64 %18)
%20 = bitcast i8* %19 to double**
store double** %20, double*** %2
store i32 0, i32* %10
br label %21
21: ; preds = %35, %0
%22 = load i32, i32* %10
%23 = load i32, i32* %9
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %38
25: ; preds = %21
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = mul i64 %27, 8
%29 = call i8* @malloc(i64 %28)
%30 = bitcast i8* %29 to double*
%31 = load double**, double*** %2
%32 = load i32, i32* %10
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double*, double** %31, i64 %33
store double* %30, double** %34
br label %35
35: ; preds = %25
%36 = load i32, i32* %10
%37 = add nsw i32 %36, 1
store i32 %37, i32* %10
br label %21
38: ; preds = %21
%39 = load double**, double*** %2
%40 = load double, double* %4
%41 = load double, double* %5
%42 = load i32, i32* %7
%43 = load i32, i32* %8
%44 = load i32, i32* %9
%45 = call i32 (double**, double, double, i32, i32, i32, ...) bitcast (i32 (...)* @iniMatriz to i32 (double**, double, double, i32, i32, i32, ...)*)(double** %39, double %40, double %41, i32 %42, i32 %43, i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%47 = load double, double* %4
store double %47, double* %11
br label %48
48: ; preds = %59, %38
%49 = load double, double* %11
%50 = load double, double* %5
%51 = fadd double %50, 1.000000e-02
%52 = fcmp olt double %49, %51
br i1 %52, label %53, label %62
53: ; preds = %48
%54 = load double, double* %11
%55 = load double, double* %11
%56 = call double @llvm.fabs.f64(double %55)
%57 = fmul double 1.000000e+01, %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %54, double %57)
br label %59
59: ; preds = %53
%60 = load double, double* %11
%61 = fadd double %60, 1.000000e-02
store double %61, double* %11
br label %48
62: ; preds = %48
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%64 = load double**, double*** %2
%65 = load i32, i32* %8
%66 = load i32, i32* %9
%67 = call i32 (double**, i32, i32, ...) bitcast (i32 (...)* @f1 to i32 (double**, i32, i32, ...)*)(double** %64, i32 %65, i32 %66)
%68 = load double, double* %4
store double %68, double* %11
br label %69
69: ; preds = %84, %62
%70 = load double, double* %11
%71 = load double, double* %5
%72 = fadd double %71, 1.000000e-02
%73 = fcmp olt double %70, %72
br i1 %73, label %74, label %87
74: ; preds = %69
%75 = load double**, double*** %2
%76 = load double, double* %11
%77 = load i32, i32* %8
%78 = load i32, i32* %9
%79 = call i32 (double**, double, i32, i32, ...) bitcast (i32 (...)* @Px to i32 (double**, double, i32, i32, ...)*)(double** %75, double %76, i32 %77, i32 %78)
%80 = sitofp i32 %79 to double
store double %80, double* %6
%81 = load double, double* %11
%82 = load double, double* %6
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %81, double %82)
br label %84
84: ; preds = %74
%85 = load double, double* %11
%86 = fadd double %85, 1.000000e-02
store double %86, double* %11
br label %69
87: ; preds = %69
store i32 0, i32* %10
br label %88
88: ; preds = %99, %87
%89 = load i32, i32* %10
%90 = load i32, i32* %8
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %102
92: ; preds = %88
%93 = load double**, double*** %2
%94 = load i32, i32* %10
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double*, double** %93, i64 %95
%97 = load double*, double** %96
%98 = bitcast double* %97 to i8*
br label %99
99: ; preds = %92
%100 = load i32, i32* %10
%101 = add nsw i32 %100, 1
store i32 %101, i32* %10
br label %88
102: ; preds = %88
%103 = load double**, double*** %2
%104 = bitcast double** %103 to i8*
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%lf %lf \0A\00"
@str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(88) i8* @malloc(i64 88)
%2 = bitcast i8* %1 to double**
%3 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%4 = bitcast i8* %1 to i8**
store i8* %3, i8** %4
%5 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%6 = getelementptr inbounds double*, double** %2, i64 1
%7 = bitcast double** %6 to i8**
store i8* %5, i8** %7
%8 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%9 = getelementptr inbounds double*, double** %2, i64 2
%10 = bitcast double** %9 to i8**
store i8* %8, i8** %10
%11 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%12 = getelementptr inbounds double*, double** %2, i64 3
%13 = bitcast double** %12 to i8**
store i8* %11, i8** %13
%14 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%15 = getelementptr inbounds double*, double** %2, i64 4
%16 = bitcast double** %15 to i8**
store i8* %14, i8** %16
%17 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%18 = getelementptr inbounds double*, double** %2, i64 5
%19 = bitcast double** %18 to i8**
store i8* %17, i8** %19
%20 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%21 = getelementptr inbounds double*, double** %2, i64 6
%22 = bitcast double** %21 to i8**
store i8* %20, i8** %22
%23 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%24 = getelementptr inbounds double*, double** %2, i64 7
%25 = bitcast double** %24 to i8**
store i8* %23, i8** %25
%26 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%27 = getelementptr inbounds double*, double** %2, i64 8
%28 = bitcast double** %27 to i8**
store i8* %26, i8** %28
%29 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%30 = getelementptr inbounds double*, double** %2, i64 9
%31 = bitcast double** %30 to i8**
store i8* %29, i8** %31
%32 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%33 = getelementptr inbounds double*, double** %2, i64 10
%34 = bitcast double** %33 to i8**
store i8* %32, i8** %34
%35 = tail call dereferenceable_or_null(96) i8* @malloc(i64 96)
%36 = getelementptr inbounds double*, double** %2, i64 11
%37 = bitcast double** %36 to i8**
store i8* %35, i8** %37
%38 = tail call i32 (double**, double, double, i32, i32, i32, ...) bitcast (i32 (...)* @iniMatriz to i32 (double**, double, double, i32, i32, i32, ...)*)(double** %2, double -1.000000e+00, double 1.000000e+00, i32 10, i32 11, i32 12)
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
br label %40
40: ; preds = %0, %40
%41 = phi double [ -1.000000e+00, %0 ], [ %45, %40 ]
%42 = tail call double @llvm.fabs.f64(double %41)
%43 = fmul double %42, 1.000000e+01
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %41, double %43)
%45 = fadd double %41, 1.000000e-02
%46 = fcmp olt double %45, 1.010000e+00
br i1 %46, label %40, label %47
47: ; preds = %40
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0))
%49 = tail call i32 (double**, i32, i32, ...) bitcast (i32 (...)* @f1 to i32 (double**, i32, i32, ...)*)(double** %2, i32 11, i32 12)
br label %50
50: ; preds = %47, %50
%51 = phi double [ -1.000000e+00, %47 ], [ %55, %50 ]
%52 = tail call i32 (double**, double, i32, i32, ...) bitcast (i32 (...)* @Px to i32 (double**, double, i32, i32, ...)*)(double** %2, double %51, i32 11, i32 12)
%53 = sitofp i32 %52 to double
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %51, double %53)
%55 = fadd double %51, 1.000000e-02
%56 = fcmp olt double %55, 1.010000e+00
br i1 %56, label %50, label %57
57: ; preds = %50
%58 = load i8*, i8** %4
tail call void @free(i8* %58)
%59 = load i8*, i8** %7
tail call void @free(i8* %59)
%60 = load i8*, i8** %10
tail call void @free(i8* %60)
%61 = load i8*, i8** %13
tail call void @free(i8* %61)
%62 = load i8*, i8** %16
tail call void @free(i8* %62)
%63 = load i8*, i8** %19
tail call void @free(i8* %63)
%64 = load i8*, i8** %22
tail call void @free(i8* %64)
%65 = load i8*, i8** %25
tail call void @free(i8* %65)
%66 = load i8*, i8** %28
tail call void @free(i8* %66)
%67 = load i8*, i8** %31
tail call void @free(i8* %67)
%68 = load i8*, i8** %34
tail call void @free(i8* %68)
tail call void @free(i8* %1)
ret i32 0
}