int main(void) {
  float a, b, c, f1, f2;
  double d1;
  unsigned long int N;
  a = 1000000000.0;
  b = 20000000.0;
  c = 20000000.0;
  f1 = (a * b) * c;
  f2 = a * (b * c);
  d1 = (double)(a) * (double)(b) * (double)(c);
  printf("f1 = %f \n", f1);
  printf("f2 = %f \n", f2);
  printf("d1 = %lf \n", d1);
  printf("Error en f1 = %10e \n", f1 - 400000000000000000000000.0);
  printf("Error en f2 = %10e \n", f2 - 400000000000000000000000.0);
  printf("Error en d1 = %10e \n", d1 - 400000000000000000000000.0);
  float acum_1, acum_2;
  N = 10000;
  acum_1 = 0.0;
  acum_1 = mysum(0.01, N);
  printf("\nacum_1 = %.20f \n", acum_1);
  printf("Error en acum_1 = %.20f \n", acum_1 - (100));
  acum_2 = 0.0;
  acum_2 = fabsf((N / 10) - mysum(0.1, N));
  printf("Error en acum_2 = %.20f \n", acum_2 - (0.0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4e6e6b28,-0x8(%rbp)
movl   $0x4b989680,-0xc(%rbp)
movl   $0x4b989680,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
mulss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe78(%rip),%rdi
mov    $0x1,%al
mov    %al,-0x41(%rbp)
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
movsd  -0x20(%rbp),%xmm0
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe12(%rip),%xmm1
movsd  %xmm1,-0x50(%rbp)
subsd  %xmm1,%xmm0
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x50(%rbp),%xmm1
mov    -0x41(%rbp),%al
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  %xmm1,%xmm0
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x50(%rbp),%xmm1
mov    -0x41(%rbp),%al
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
movq   $0x2710,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
movsd  0xda9(%rip),%xmm0
call   1040 <mysum@plt>
mov    %eax,%ecx
mov    -0x41(%rbp),%al
cvtsi2ss %ecx,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
movss  -0x2c(%rbp),%xmm0
movss  0xd81(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rdi,%rax
mul    %rcx
mov    -0x41(%rbp),%al
shr    $0x3,%rdx
mov    %rdx,-0x40(%rbp)
movsd  0xd37(%rip),%xmm0
call   1040 <mysum@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x38(%rbp)
test   %rax,%rax
movss  %xmm0,-0x34(%rbp)
js     1333 <main+0x213>
movss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
movaps 0xcc1(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm0
lea    0xd57(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf14(%rip),%rdi
movsd  0xed0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
movsd  0xec2(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
movsd  0xeb4(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
movsd  0xea6(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
movsd  0xe98(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe80(%rip),%xmm0
mov    $0x2710,%edi
mov    $0x1,%al
call   1040 <mysum@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xece(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
addss  0xe57(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe35(%rip),%xmm0
mov    $0x2710,%edi
mov    $0x1,%al
call   1040 <mysum@plt>
movslq %eax,%rcx
mov    $0x3e8,%eax
sub    %rcx,%rax
js     121e <main+0xfe>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
jmp    1236 <main+0x116>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe85(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"f1 = %f \0A\00"
@.str.1 = [10 x i8] c"f2 = %f \0A\00"
@.str.2 = [11 x i8] c"d1 = %lf \0A\00"
@.str.3 = [21 x i8] c"Error en f1 = %10e \0A\00"
@.str.4 = [21 x i8] c"Error en f2 = %10e \0A\00"
@.str.5 = [21 x i8] c"Error en d1 = %10e \0A\00"
@.str.6 = [18 x i8] c"\0Aacum_1 = %.20f \0A\00"
@.str.7 = [26 x i8] c"Error en acum_1 = %.20f \0A\00"
@.str.8 = [26 x i8] c"Error en acum_2 = %.20f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca double
%8 = alloca i64
%9 = alloca float
%10 = alloca float
store i32 0, i32* %1
store float 1.000000e+09, float* %2
store float 2.000000e+07, float* %3
store float 2.000000e+07, float* %4
%11 = load float, float* %2
%12 = load float, float* %3
%13 = fmul float %11, %12
%14 = load float, float* %4
%15 = fmul float %13, %14
store float %15, float* %5
%16 = load float, float* %2
%17 = load float, float* %3
%18 = load float, float* %4
%19 = fmul float %17, %18
%20 = fmul float %16, %19
store float %20, float* %6
%21 = load float, float* %2
%22 = fpext float %21 to double
%23 = load float, float* %3
%24 = fpext float %23 to double
%25 = fmul double %22, %24
%26 = load float, float* %4
%27 = fpext float %26 to double
%28 = fmul double %25, %27
store double %28, double* %7
%29 = load float, float* %5
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %30)
%32 = load float, float* %6
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %33)
%35 = load double, double* %7
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double %35)
%37 = load float, float* %5
%38 = fpext float %37 to double
%39 = fsub double %38, 4.000000e+23
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), double %39)
%41 = load float, float* %6
%42 = fpext float %41 to double
%43 = fsub double %42, 4.000000e+23
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %43)
%45 = load double, double* %7
%46 = fsub double %45, 4.000000e+23
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), double %46)
store i64 10000, i64* %8
store float 0.000000e+00, float* %9
%48 = load i64, i64* %8
%49 = call i32 (double, i64, ...) bitcast (i32 (...)* @mysum to i32 (double, i64, ...)*)(double 1.000000e-02, i64 %48)
%50 = sitofp i32 %49 to float
store float %50, float* %9
%51 = load float, float* %9
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), double %52)
%54 = load float, float* %9
%55 = fsub float %54, 1.000000e+02
%56 = fpext float %55 to double
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), double %56)
store float 0.000000e+00, float* %10
%58 = load i64, i64* %8
%59 = udiv i64 %58, 10
%60 = load i64, i64* %8
%61 = call i32 (double, i64, ...) bitcast (i32 (...)* @mysum to i32 (double, i64, ...)*)(double 1.000000e-01, i64 %60)
%62 = sext i32 %61 to i64
%63 = sub i64 %59, %62
%64 = uitofp i64 %63 to float
%65 = call float @llvm.fabs.f32(float %64)
store float %65, float* %10
%66 = load float, float* %10
%67 = fpext float %66 to double
%68 = fsub double %67, 0.000000e+00
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), double %68)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"f1 = %f \0A\00"
@.str.1 = [10 x i8] c"f2 = %f \0A\00"
@.str.2 = [11 x i8] c"d1 = %lf \0A\00"
@.str.3 = [21 x i8] c"Error en f1 = %10e \0A\00"
@.str.4 = [21 x i8] c"Error en f2 = %10e \0A\00"
@.str.5 = [21 x i8] c"Error en d1 = %10e \0A\00"
@.str.6 = [18 x i8] c"\0Aacum_1 = %.20f \0A\00"
@.str.7 = [26 x i8] c"Error en acum_1 = %.20f \0A\00"
@.str.8 = [26 x i8] c"Error en acum_2 = %.20f \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double 0x44D52D02E0000000)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 0x44D52D02C0000000)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double 4.000000e+23)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), double 0x43581EB50A000000)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double 0xC33F852BD8000000)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), double 0.000000e+00)
%7 = tail call i32 (double, i64, ...) bitcast (i32 (...)* @mysum to i32 (double, i64, ...)*)(double 1.000000e-02, i64 10000)
%8 = sitofp i32 %7 to float
%9 = fpext float %8 to double
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), double %9)
%11 = fadd float %8, -1.000000e+02
%12 = fpext float %11 to double
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), double %12)
%14 = tail call i32 (double, i64, ...) bitcast (i32 (...)* @mysum to i32 (double, i64, ...)*)(double 1.000000e-01, i64 10000)
%15 = sext i32 %14 to i64
%16 = sub nsw i64 1000, %15
%17 = uitofp i64 %16 to float
%18 = fpext float %17 to double
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), double %18)
ret i32 0
}