double FpUcurve_d(const double inpVal, const double hard) {
  return (double)(inpVal >= 0.0
                      ? (inpVal * (hard + inpVal) /
                         (1.0 + (hard * inpVal) + (inpVal * inpVal)))
                      : (inpVal * (hard - inpVal) /
                         (1.0 - (hard * inpVal) + (inpVal * inpVal))));
}


x86 assembly (clang, -O0):
<FpUcurve_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     116d <FpUcurve_d+0x6d>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm2
movsd  0xeb7(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11cc <FpUcurve_d+0xcc>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm1,%xmm2
movsd  0xe53(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FpUcurve_d>:
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
movapd 0xeec(%rip),%xmm4
movapd %xmm1,%xmm3
jae    111e <FpUcurve_d+0x1e>
xorpd  %xmm4,%xmm3
xorpd  %xmm2,%xmm4
cmpnlesd %xmm2,%xmm0
andpd  %xmm0,%xmm4
andnpd %xmm2,%xmm0
orpd   %xmm4,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm3
addsd  0xecd(%rip),%xmm3
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @FpUcurve_d(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 = fcmp oge double %5, 0.000000e+00
br i1 %6, label %7, label %20
7: ; preds = %2
%8 = load double, double* %3
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fadd double %9, %10
%12 = fmul double %8, %11
%13 = load double, double* %4
%14 = load double, double* %3
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double 1.000000e+00)
%16 = load double, double* %3
%17 = load double, double* %3
%18 = call double @llvm.fmuladd.f64(double %16, double %17, double %15)
%19 = fdiv double %12, %18
br label %34
20: ; preds = %2
%21 = load double, double* %3
%22 = load double, double* %4
%23 = load double, double* %3
%24 = fsub double %22, %23
%25 = fmul double %21, %24
%26 = load double, double* %4
%27 = load double, double* %3
%28 = fneg double %26
%29 = call double @llvm.fmuladd.f64(double %28, double %27, double 1.000000e+00)
%30 = load double, double* %3
%31 = load double, double* %3
%32 = call double @llvm.fmuladd.f64(double %30, double %31, double %29)
%33 = fdiv double %25, %32
br label %34
34: ; preds = %20, %7
%35 = phi double [ %19, %7 ], [ %33, %20 ]
ret double %35
}

LLVM IR (-O2):
define double @FpUcurve_d(double %0, double %1) {
%3 = fcmp ult double %0, 0.000000e+00
%4 = fneg double %1
%5 = select i1 %3, double %4, double %1
%6 = fneg double %0
%7 = select i1 %3, double %6, double %0
%8 = fadd double %7, %1
%9 = fmul double %8, %0
%10 = tail call double @llvm.fmuladd.f64(double %5, double %0, double 1.000000e+00)
%11 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %10)
%12 = fdiv double %9, %11
ret double %12
}