float Fone(x)
float x;
{
  float y;
  if (x < 1.e-7)
    return 0.;
  y = sqrt(x);
  y = .5 * 1.7724538509055160272981674 / y * erf(y);
  return (y - exp(-x)) / (x + x);
}


x86 assembly (clang, -O0):
<Fone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1169 <Fone+0x39>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    120d <Fone+0xdd>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1040 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe77(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <erf@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fone>:
sub    $0x28,%rsp
cvtsd2ss %xmm0,%xmm3
cvtss2sd %xmm3,%xmm1
xorps  %xmm0,%xmm0
movsd  0xeb9(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     11d5 <Fone+0xa5>
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm3
movaps %xmm3,0x10(%rsp)
jb     1167 <Fone+0x37>
xorps  %xmm0,%xmm0
sqrtss %xmm3,%xmm0
jmp    116f <Fone+0x3f>
movaps %xmm3,%xmm0
call   1040 <sqrtf@plt>
cvtss2sd %xmm0,%xmm0
movsd  0xe8d(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
call   1050 <erf@plt>
mulsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movaps 0xe6b(%rip),%xmm0
xorps  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movaps 0x10(%rsp),%xmm0
addss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @Fone(double %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = fptrunc double %0 to float
store float %5, float* %3
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fcmp olt double %7, 0x3E7AD7F29ABCAF48
br i1 %8, label %9, label %10
9: ; preds = %1
store float 0.000000e+00, float* %2
br label %36
10: ; preds = %1
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = call double @sqrt(double %12)
%14 = fptrunc double %13 to float
store float %14, float* %4
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = fdiv double 0x3FEC5BF891B4EF6B, %16
%18 = load float, float* %4
%19 = fpext float %18 to double
%20 = call double @erf(double %19)
%21 = fmul double %17, %20
%22 = fptrunc double %21 to float
store float %22, float* %4
%23 = load float, float* %4
%24 = fpext float %23 to double
%25 = load float, float* %3
%26 = fneg float %25
%27 = fpext float %26 to double
%28 = call double @exp(double %27)
%29 = fsub double %24, %28
%30 = load float, float* %3
%31 = load float, float* %3
%32 = fadd float %30, %31
%33 = fpext float %32 to double
%34 = fdiv double %29, %33
%35 = fptrunc double %34 to float
store float %35, float* %2
br label %36
36: ; preds = %10, %9
%37 = load float, float* %2
ret float %37
}

LLVM IR (-O2):
define float @Fone(double %0) {
%2 = fptrunc double %0 to float
%3 = fpext float %2 to double
%4 = fcmp olt double %3, 0x3E7AD7F29ABCAF48
br i1 %4, label %21, label %5
5: ; preds = %1
%6 = tail call float @sqrtf(float %2)
%7 = fpext float %6 to double
%8 = fdiv double 0x3FEC5BF891B4EF6B, %7
%9 = tail call double @erf(double %7)
%10 = fmul double %9, %8
%11 = fptrunc double %10 to float
%12 = fpext float %11 to double
%13 = fneg float %2
%14 = fpext float %13 to double
%15 = tail call double @exp(double %14)
%16 = fsub double %12, %15
%17 = fadd float %2, %2
%18 = fpext float %17 to double
%19 = fdiv double %16, %18
%20 = fptrunc double %19 to float
br label %21
21: ; preds = %1, %5
%22 = phi float [ %20, %5 ], [ 0.000000e+00, %1 ]
ret float %22
}