#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double fabs(double);
int /*<<< orphan*/ printf(char *, ...);
double truncf(double);
main() {
  double x_8 = 0.71428571;
  double y_8 = 0.33333333;
  double u_8 = 0.714251;
  double v_8 = 98765.9;
  double pres = 1e5;
  double x_5 = truncf(x_8 * pres) / pres;
  double y_5 = truncf(y_8 * pres) / pres;
  double u_5 = truncf(u_8 * pres) / pres;
  double v_5 = truncf(v_8 * pres) / pres;
  printf("Operacion \t Valor a 8 \t Aritmetica de maquina \t \t ErrA \t  \t \t "
         "ErrR \n");
  double res_8 = x_8 + y_8;
  double res_5 = x_5 + y_5;
  res_5 = truncf(res_5 * pres) / pres;
  double errA = fabs(res_8 - res_5);
  double errR = errA / fabs(res_8);
  printf("x+y \t \t %f \t \t %f \t \t %e \t \t %e \n", res_8, res_5, errA,
         errR);
  res_8 = x_8 * y_8;
  res_5 = x_5 * y_5;
  res_5 = truncf(res_5 * pres) / pres;
  errA = fabs(res_8 - res_5);
  errR = errA / fabs(res_8);
  printf("x*y \t \t %f \t \t %f \t \t %e \t \t %e \n", res_8, res_5, errA,
         errR);
  res_8 = x_8 - u_8;
  res_5 = x_5 - u_5;
  res_5 = truncf(res_5 * pres) / pres;
  errA = fabs(res_8 - res_5);
  errR = errA / fabs(res_8);
  printf("x-u \t \t %f \t \t %f \t \t %e \t \t %e \n", res_8, res_5, errA,
         errR);
  res_8 = (x_8 - u_8) * v_8;
  res_5 = (x_5 - u_5) * v_5;
  res_5 = truncf(res_5 * pres) / pres;
  errA = fabs(res_8 - res_5);
  errR = errA / fabs(res_8);
  printf("(x-u)*v \t %f \t \t %f \t \t %e \t \t %e \n", res_8, res_5, errA,
         errR);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  0xf00(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <truncf@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <truncf@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <truncf@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <truncf@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <truncf@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movaps 0xddd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movaps 0xdc3(%rip),%xmm2
pand   %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
lea    0xe18(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <truncf@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movaps 0xd4c(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movaps 0xd32(%rip),%xmm2
pand   %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
lea    0xda9(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <truncf@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movaps 0xcbb(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movaps 0xca1(%rip),%xmm2
pand   %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
lea    0xd3a(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <truncf@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movaps 0xc20(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movaps 0xc06(%rip),%xmm2
pand   %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
lea    0xcc1(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
call   1050 <truncf@plt>
movsd  0xec2(%rip),%xmm0
call   1050 <truncf@plt>
movsd  0xebd(%rip),%xmm0
call   1050 <truncf@plt>
movsd  0xeb8(%rip),%xmm0
call   1050 <truncf@plt>
lea    0xfde(%rip),%rdi
call   1030 <puts@plt>
movsd  0xea7(%rip),%xmm0
call   1050 <truncf@plt>
lea    0xf3b(%rip),%rdi
movsd  0xe9b(%rip),%xmm0
movsd  0xe9b(%rip),%xmm1
movsd  0xe9b(%rip),%xmm2
movsd  0xe9b(%rip),%xmm3
mov    $0x4,%al
call   1040 <printf@plt>
movsd  0xe94(%rip),%xmm0
call   1050 <truncf@plt>
lea    0xf22(%rip),%rdi
movsd  0xe88(%rip),%xmm0
movsd  0xe88(%rip),%xmm1
movsd  0xe88(%rip),%xmm2
movsd  0xe88(%rip),%xmm3
mov    $0x4,%al
call   1040 <printf@plt>
movsd  0xe81(%rip),%xmm0
call   1050 <truncf@plt>
lea    0xf09(%rip),%rdi
movsd  0xe75(%rip),%xmm0
movsd  0xe75(%rip),%xmm1
movsd  0xe75(%rip),%xmm2
movsd  0xe75(%rip),%xmm3
mov    $0x4,%al
call   1040 <printf@plt>
movsd  0xe6e(%rip),%xmm0
call   1050 <truncf@plt>
lea    0xef0(%rip),%rdi
movsd  0xe62(%rip),%xmm0
movsd  0xe62(%rip),%xmm1
movsd  0xe62(%rip),%xmm2
movsd  0xe62(%rip),%xmm3
mov    $0x4,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"Operacion \09 Valor a 8 \09 Aritmetica de maquina \09 \09 ErrA \09 \09 \09 ErrR \0A\00"
@.str.1 = [34 x i8] c"x+y \09 \09 %f \09 \09 %f \09 \09 %e \09 \09 %e \0A\00"
@.str.2 = [34 x i8] c"x*y \09 \09 %f \09 \09 %f \09 \09 %e \09 \09 %e \0A\00"
@.str.3 = [34 x i8] c"x-u \09 \09 %f \09 \09 %f \09 \09 %e \09 \09 %e \0A\00"
@.str.4 = [36 x i8] c"(x-u)*v \09 %f \09 \09 %f \09 \09 %e \09 \09 %e \0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double 0x3FE6DB6DB48E678C, double* %1
store double 0x3FD5555551C112DA, double* %2
store double 7.142510e-01, double* %3
store double 0x40F81CDE66666666, double* %4
store double 1.000000e+05, double* %5
%14 = load double, double* %1
%15 = load double, double* %5
%16 = fmul double %14, %15
%17 = call double @truncf(double %16)
%18 = load double, double* %5
%19 = fdiv double %17, %18
store double %19, double* %6
%20 = load double, double* %2
%21 = load double, double* %5
%22 = fmul double %20, %21
%23 = call double @truncf(double %22)
%24 = load double, double* %5
%25 = fdiv double %23, %24
store double %25, double* %7
%26 = load double, double* %3
%27 = load double, double* %5
%28 = fmul double %26, %27
%29 = call double @truncf(double %28)
%30 = load double, double* %5
%31 = fdiv double %29, %30
store double %31, double* %8
%32 = load double, double* %4
%33 = load double, double* %5
%34 = fmul double %32, %33
%35 = call double @truncf(double %34)
%36 = load double, double* %5
%37 = fdiv double %35, %36
store double %37, double* %9
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%39 = load double, double* %1
%40 = load double, double* %2
%41 = fadd double %39, %40
store double %41, double* %10
%42 = load double, double* %6
%43 = load double, double* %7
%44 = fadd double %42, %43
store double %44, double* %11
%45 = load double, double* %11
%46 = load double, double* %5
%47 = fmul double %45, %46
%48 = call double @truncf(double %47)
%49 = load double, double* %5
%50 = fdiv double %48, %49
store double %50, double* %11
%51 = load double, double* %10
%52 = load double, double* %11
%53 = fsub double %51, %52
%54 = call double @llvm.fabs.f64(double %53)
store double %54, double* %12
%55 = load double, double* %12
%56 = load double, double* %10
%57 = call double @llvm.fabs.f64(double %56)
%58 = fdiv double %55, %57
store double %58, double* %13
%59 = load double, double* %10
%60 = load double, double* %11
%61 = load double, double* %12
%62 = load double, double* %13
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double %59, double %60, double %61, double %62)
%64 = load double, double* %1
%65 = load double, double* %2
%66 = fmul double %64, %65
store double %66, double* %10
%67 = load double, double* %6
%68 = load double, double* %7
%69 = fmul double %67, %68
store double %69, double* %11
%70 = load double, double* %11
%71 = load double, double* %5
%72 = fmul double %70, %71
%73 = call double @truncf(double %72)
%74 = load double, double* %5
%75 = fdiv double %73, %74
store double %75, double* %11
%76 = load double, double* %10
%77 = load double, double* %11
%78 = fsub double %76, %77
%79 = call double @llvm.fabs.f64(double %78)
store double %79, double* %12
%80 = load double, double* %12
%81 = load double, double* %10
%82 = call double @llvm.fabs.f64(double %81)
%83 = fdiv double %80, %82
store double %83, double* %13
%84 = load double, double* %10
%85 = load double, double* %11
%86 = load double, double* %12
%87 = load double, double* %13
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double %84, double %85, double %86, double %87)
%89 = load double, double* %1
%90 = load double, double* %3
%91 = fsub double %89, %90
store double %91, double* %10
%92 = load double, double* %6
%93 = load double, double* %8
%94 = fsub double %92, %93
store double %94, double* %11
%95 = load double, double* %11
%96 = load double, double* %5
%97 = fmul double %95, %96
%98 = call double @truncf(double %97)
%99 = load double, double* %5
%100 = fdiv double %98, %99
store double %100, double* %11
%101 = load double, double* %10
%102 = load double, double* %11
%103 = fsub double %101, %102
%104 = call double @llvm.fabs.f64(double %103)
store double %104, double* %12
%105 = load double, double* %12
%106 = load double, double* %10
%107 = call double @llvm.fabs.f64(double %106)
%108 = fdiv double %105, %107
store double %108, double* %13
%109 = load double, double* %10
%110 = load double, double* %11
%111 = load double, double* %12
%112 = load double, double* %13
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), double %109, double %110, double %111, double %112)
%114 = load double, double* %1
%115 = load double, double* %3
%116 = fsub double %114, %115
%117 = load double, double* %4
%118 = fmul double %116, %117
store double %118, double* %10
%119 = load double, double* %6
%120 = load double, double* %8
%121 = fsub double %119, %120
%122 = load double, double* %9
%123 = fmul double %121, %122
store double %123, double* %11
%124 = load double, double* %11
%125 = load double, double* %5
%126 = fmul double %124, %125
%127 = call double @truncf(double %126)
%128 = load double, double* %5
%129 = fdiv double %127, %128
store double %129, double* %11
%130 = load double, double* %10
%131 = load double, double* %11
%132 = fsub double %130, %131
%133 = call double @llvm.fabs.f64(double %132)
store double %133, double* %12
%134 = load double, double* %12
%135 = load double, double* %10
%136 = call double @llvm.fabs.f64(double %135)
%137 = fdiv double %134, %136
store double %137, double* %13
%138 = load double, double* %10
%139 = load double, double* %11
%140 = load double, double* %12
%141 = load double, double* %13
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), double %138, double %139, double %140, double %141)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"x+y \09 \09 %f \09 \09 %f \09 \09 %e \09 \09 %e \0A\00"
@.str.2 = [34 x i8] c"x*y \09 \09 %f \09 \09 %f \09 \09 %e \09 \09 %e \0A\00"
@.str.3 = [34 x i8] c"x-u \09 \09 %f \09 \09 %f \09 \09 %e \09 \09 %e \0A\00"
@.str.4 = [36 x i8] c"(x-u)*v \09 %f \09 \09 %f \09 \09 %e \09 \09 %e \0A\00"
@str = [68 x i8] c"Operacion \09 Valor a 8 \09 Aritmetica de maquina \09 \09 ErrA \09 \09 \09 ErrR \00"
define i32 @main() {
%1 = tail call double @truncf(double 0x40F1704922D0E560)
%2 = tail call double @truncf(double 0x40E046AAA7EF9DB2)
%3 = tail call double @truncf(double 0x40F1701199999999)
%4 = tail call double @truncf(double 9.876590e+09)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%6 = tail call double @truncf(double 0x40F9939000000001)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double 0x3FF0C30C2EB7787C, double 1.047610e+00, double 0x3EE2F55023AE0000, double 0x3EE218B53B89E6C3)
%8 = tail call double @truncf(double 0x40D7404618698352)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), double 0x3FCE79E7964B98CE, double 2.380900e-01, double 0x3ED5F44580618000, double 0x3EF70D49003016D4)
%10 = tail call double @truncf(double 0x4007FFFFFFFFE990)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), double 0x3F0232B284CD0000, double 2.000000e-05, double 0x3EEED95F016D2E1E, double 0x3FDB1F7E316A3FC7)
%12 = tail call double @truncf(double 0x411215A6CCCCBBE5)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), double 0x400B6CE173808314, double 2.962970e+00, double 0x3FDDC5BEAFC23B88, double 0x3FC15E8BB53622F8)
ret i32 0
}