double double_not_comparison(const double a, const double b) {
  const double epsilon = 1e-14;
  if (a == b)
    return 0;
  else if ((a > b) && ((a - b) < epsilon))
    return 0;
  else if ((b > a) && ((b - a) < epsilon))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<double_not_comparison>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xeea(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    113e <double_not_comparison+0x3e>
jp     113e <double_not_comparison+0x3e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c7 <double_not_comparison+0xc7>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1177 <double_not_comparison+0x77>
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  0xea0(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1177 <double_not_comparison+0x77>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c7 <double_not_comparison+0xc7>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11b0 <double_not_comparison+0xb0>
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xe67(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11b0 <double_not_comparison+0xb0>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c7 <double_not_comparison+0xc7>
jmp    11b5 <double_not_comparison+0xb5>
jmp    11ba <double_not_comparison+0xba>
movsd  0xe46(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_not_comparison>:
xorps  %xmm2,%xmm2
ucomisd %xmm1,%xmm0
jne    110f <double_not_comparison+0xf>
jp     110f <double_not_comparison+0xf>
movaps %xmm2,%xmm0
ret
jbe    1127 <double_not_comparison+0x27>
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
movsd  0xedf(%rip),%xmm4
ucomisd %xmm3,%xmm4
ja     110b <double_not_comparison+0xb>
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
cmpltsd 0xec3(%rip),%xmm2
movsd  0xec3(%rip),%xmm1
andnpd %xmm1,%xmm2
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
movapd %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @double_not_comparison(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double 0x3D06849B86A12B9B, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp oeq double %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store double 0.000000e+00, double* %3
br label %34
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %5
%14 = fcmp ogt double %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load double, double* %4
%17 = load double, double* %5
%18 = fsub double %16, %17
%19 = fcmp olt double %18, 0x3D06849B86A12B9B
br i1 %19, label %20, label %21
20: ; preds = %15
store double 0.000000e+00, double* %3
br label %34
21: ; preds = %15, %11
%22 = load double, double* %5
%23 = load double, double* %4
%24 = fcmp ogt double %22, %23
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = load double, double* %5
%27 = load double, double* %4
%28 = fsub double %26, %27
%29 = fcmp olt double %28, 0x3D06849B86A12B9B
br i1 %29, label %30, label %31
30: ; preds = %25
store double 0.000000e+00, double* %3
br label %34
31: ; preds = %25, %21
br label %32
32: ; preds = %31
br label %33
33: ; preds = %32
store double 1.000000e+00, double* %3
br label %34
34: ; preds = %33, %30, %20, %10
%35 = load double, double* %3
ret double %35
}

LLVM IR (-O2):
define double @double_not_comparison(double %0, double %1) {
%3 = fcmp oeq double %0, %1
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = fcmp ogt double %0, %1
%6 = fsub double %0, %1
%7 = fcmp olt double %6, 0x3D06849B86A12B9B
%8 = and i1 %5, %7
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = fcmp ogt double %1, %0
%11 = fsub double %1, %0
%12 = fcmp olt double %11, 0x3D06849B86A12B9B
%13 = and i1 %10, %12
%14 = select i1 %13, double 0.000000e+00, double 1.000000e+00
br label %15
15: ; preds = %9, %4, %2
%16 = phi double [ 0.000000e+00, %2 ], [ 0.000000e+00, %4 ], [ %14, %9 ]
ret double %16
}