float LOOKUP(float x) {
  if (x <= 1.00f)
    return ((-0.009350833524763f * x + 0.130659527668286f) * x +
            0.498799810682272f) *
               x +
           0.693203116424741f;
  if (x <= 2.50f)
    return ((-0.014532321752540f * x + 0.139942324101744f) * x +
            0.495635523139337f) *
               x +
           0.692140569840976f;
  if (x <= 4.50f)
    return ((-0.004605031767994f * x + 0.063427417320019f) * x +
            0.695956496475118f) *
               x +
           0.514272634594009f;
  return ((-0.000458661602210f * x + 0.009695946122598f) * x +
          0.930734667215156f) *
             x +
         0.168037164329057f;
}


x86 assembly (clang, -O0):
<LOOKUP>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     116c <LOOKUP+0x6c>
movss  -0x8(%rbp),%xmm0
movss  0xf1c(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xf14(%rip),%xmm1
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xef7(%rip),%xmm1
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xede(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <LOOKUP+0x17e>
movss  0xe90(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11cf <LOOKUP+0xcf>
movss  -0x8(%rbp),%xmm0
movss  0xea9(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xea1(%rip),%xmm1
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe84(%rip),%xmm1
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe6b(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <LOOKUP+0x17e>
movss  0xe31(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1232 <LOOKUP+0x132>
movss  -0x8(%rbp),%xmm0
movss  0xe36(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe2e(%rip),%xmm1
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe11(%rip),%xmm1
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xdf8(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    127e <LOOKUP+0x17e>
movss  -0x8(%rbp),%xmm0
movss  0xdd5(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xdcd(%rip),%xmm1
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xdb0(%rip),%xmm1
addss  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xd97(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOOKUP>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    115b <LOOKUP+0x5b>
movss  0xeff(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    118b <LOOKUP+0x8b>
movss  0xf06(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11bb <LOOKUP+0xbb>
movss  0xf09(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xf01(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xef9(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xef1(%rip),%xmm1
movaps %xmm1,%xmm0
ret
movss  0xea1(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe99(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe91(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe89(%rip),%xmm1
movaps %xmm1,%xmm0
ret
movss  0xe85(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe7d(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe75(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe6d(%rip),%xmm1
movaps %xmm1,%xmm0
ret
movss  0xe69(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe61(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe59(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe51(%rip),%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @LOOKUP(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, 1.000000e+00
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load float, float* %3
%8 = call float @llvm.fmuladd.f32(float 0xBF832687A0000000, float %7, float 0x3FC0B97380000000)
%9 = load float, float* %3
%10 = call float @llvm.fmuladd.f32(float %8, float %9, float 0x3FDFEC5600000000)
%11 = load float, float* %3
%12 = call float @llvm.fmuladd.f32(float %10, float %11, float 0x3FE62EB840000000)
store float %12, float* %2
br label %40
13: ; preds = %1
%14 = load float, float* %3
%15 = fcmp ole float %14, 2.500000e+00
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load float, float* %3
%18 = call float @llvm.fmuladd.f32(float 0xBF8DC31F40000000, float %17, float 0x3FC1E9A140000000)
%19 = load float, float* %3
%20 = call float @llvm.fmuladd.f32(float %18, float %19, float 0x3FDFB87E00000000)
%21 = load float, float* %3
%22 = call float @llvm.fmuladd.f32(float %20, float %21, float 0x3FE6260400000000)
store float %22, float* %2
br label %40
23: ; preds = %13
%24 = load float, float* %3
%25 = fcmp ole float %24, 4.500000e+00
br i1 %25, label %26, label %33
26: ; preds = %23
%27 = load float, float* %3
%28 = call float @llvm.fmuladd.f32(float 0xBF72DCB9C0000000, float %27, float 0x3FB03CC780000000)
%29 = load float, float* %3
%30 = call float @llvm.fmuladd.f32(float %28, float %29, float 0x3FE6454680000000)
%31 = load float, float* %3
%32 = call float @llvm.fmuladd.f32(float %30, float %31, float 0x3FE074EBE0000000)
store float %32, float* %2
br label %40
33: ; preds = %23
%34 = load float, float* %3
%35 = call float @llvm.fmuladd.f32(float 0xBF3E0F10A0000000, float %34, float 0x3F83DB77E0000000)
%36 = load float, float* %3
%37 = call float @llvm.fmuladd.f32(float %35, float %36, float 0x3FEDC89420000000)
%38 = load float, float* %3
%39 = call float @llvm.fmuladd.f32(float %37, float %38, float 0x3FC5823DE0000000)
store float %39, float* %2
br label %40
40: ; preds = %33, %26, %16, %6
%41 = load float, float* %2
ret float %41
}

LLVM IR (-O2):
define float @LOOKUP(float %0) {
%2 = fcmp ugt float %0, 1.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float 0xBF832687A0000000, float 0x3FC0B97380000000)
%5 = tail call float @llvm.fmuladd.f32(float %4, float %0, float 0x3FDFEC5600000000)
%6 = tail call float @llvm.fmuladd.f32(float %5, float %0, float 0x3FE62EB840000000)
br label %23
7: ; preds = %1
%8 = fcmp ugt float %0, 2.500000e+00
br i1 %8, label %13, label %9
9: ; preds = %7
%10 = tail call float @llvm.fmuladd.f32(float %0, float 0xBF8DC31F40000000, float 0x3FC1E9A140000000)
%11 = tail call float @llvm.fmuladd.f32(float %10, float %0, float 0x3FDFB87E00000000)
%12 = tail call float @llvm.fmuladd.f32(float %11, float %0, float 0x3FE6260400000000)
br label %23
13: ; preds = %7
%14 = fcmp ugt float %0, 4.500000e+00
br i1 %14, label %19, label %15
15: ; preds = %13
%16 = tail call float @llvm.fmuladd.f32(float %0, float 0xBF72DCB9C0000000, float 0x3FB03CC780000000)
%17 = tail call float @llvm.fmuladd.f32(float %16, float %0, float 0x3FE6454680000000)
%18 = tail call float @llvm.fmuladd.f32(float %17, float %0, float 0x3FE074EBE0000000)
br label %23
19: ; preds = %13
%20 = tail call float @llvm.fmuladd.f32(float %0, float 0xBF3E0F10A0000000, float 0x3F83DB77E0000000)
%21 = tail call float @llvm.fmuladd.f32(float %20, float %0, float 0x3FEDC89420000000)
%22 = tail call float @llvm.fmuladd.f32(float %21, float %0, float 0x3FC5823DE0000000)
br label %23
23: ; preds = %19, %15, %9, %3
%24 = phi float [ %6, %3 ], [ %12, %9 ], [ %18, %15 ], [ %22, %19 ]
ret float %24
}