double rj0(x)
double x;
{
  if (x <= 0.0)
    x = -x;
  if (x < 8.0)
    return (jzero(x));
  else
    return (
        sqrt(0.63661977236758134307553505349005744 / x) *
        (pzero(x) * cos(x - 0.78539816339744830961566084581987572) -
         8.0 / x * qzero(x) * sin(x - 0.78539816339744830961566084581987572)));
}


x86 assembly (clang, -O0):
<rj0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     119c <rj0+0x3c>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe5c(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11c9 <rj0+0x69>
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <jzero@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1299 <rj0+0x139>
movsd  0xe3f(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1080 <pzero@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe06(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xde8(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1050 <qzero@plt>
movsd  -0x38(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xdbb(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rj0>:
sub    $0x48,%rsp
movapd 0xe94(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm3
cmpnlesd %xmm1,%xmm3
andpd  %xmm3,%xmm0
andnpd %xmm2,%xmm3
orpd   %xmm0,%xmm3
movsd  0xe7f(%rip),%xmm0
ucomisd %xmm3,%xmm0
jbe    11ae <rj0+0x4e>
movapd %xmm3,%xmm0
mov    $0x1,%al
call   1030 <jzero@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x48,%rsp
ret
movsd  0xe62(%rip),%xmm0
divsd  %xmm3,%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm3,0x10(%rsp)
jb     11cc <rj0+0x6c>
sqrtsd %xmm0,%xmm0
jmp    11d7 <rj0+0x77>
call   1070 <sqrt@plt>
movapd 0x10(%rsp),%xmm3
movsd  %xmm0,0x8(%rsp)
movapd %xmm3,%xmm0
mov    $0x1,%al
call   1080 <pzero@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0xe23(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
call   1060 <cos@plt>
movsd  %xmm0,0x38(%rsp)
movaps 0x10(%rsp),%xmm0
mov    $0x1,%al
call   1050 <qzero@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x30(%rsp),%xmm0
call   1040 <sin@plt>
movsd  0xde8(%rip),%xmm1
divsd  0x10(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x38(%rsp),%xmm0
mulsd  0x40(%rsp),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @rj0(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %3
br label %9
9: ; preds = %6, %1
%10 = load double, double* %3
%11 = fcmp olt double %10, 8.000000e+00
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load double, double* %3
%14 = call i32 (double, ...) bitcast (i32 (...)* @jzero to i32 (double, ...)*)(double %13)
%15 = sitofp i32 %14 to double
store double %15, double* %2
br label %39
16: ; preds = %9
%17 = load double, double* %3
%18 = fdiv double 0x3FE45F306DC9C883, %17
%19 = call double @sqrt(double %18)
%20 = load double, double* %3
%21 = call i32 (double, ...) bitcast (i32 (...)* @pzero to i32 (double, ...)*)(double %20)
%22 = sitofp i32 %21 to double
%23 = load double, double* %3
%24 = fsub double %23, 0x3FE921FB54442D18
%25 = call double @cos(double %24)
%26 = load double, double* %3
%27 = fdiv double 8.000000e+00, %26
%28 = load double, double* %3
%29 = call i32 (double, ...) bitcast (i32 (...)* @qzero to i32 (double, ...)*)(double %28)
%30 = sitofp i32 %29 to double
%31 = fmul double %27, %30
%32 = load double, double* %3
%33 = fsub double %32, 0x3FE921FB54442D18
%34 = call double @sin(double %33)
%35 = fmul double %31, %34
%36 = fneg double %35
%37 = call double @llvm.fmuladd.f64(double %22, double %25, double %36)
%38 = fmul double %19, %37
store double %38, double* %2
br label %39
39: ; preds = %16, %12
%40 = load double, double* %2
ret double %40
}

LLVM IR (-O2):
define double @rj0(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
%5 = fcmp olt double %4, 8.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 (double, ...) bitcast (i32 (...)* @jzero to i32 (double, ...)*)(double %4)
%8 = sitofp i32 %7 to double
br label %24
9: ; preds = %1
%10 = fdiv double 0x3FE45F306DC9C883, %4
%11 = tail call double @sqrt(double %10)
%12 = tail call i32 (double, ...) bitcast (i32 (...)* @pzero to i32 (double, ...)*)(double %4)
%13 = sitofp i32 %12 to double
%14 = fadd double %4, 0xBFE921FB54442D18
%15 = tail call double @cos(double %14)
%16 = tail call i32 (double, ...) bitcast (i32 (...)* @qzero to i32 (double, ...)*)(double %4)
%17 = sitofp i32 %16 to double
%18 = tail call double @sin(double %14)
%19 = fdiv double -8.000000e+00, %4
%20 = fmul double %19, %17
%21 = fmul double %18, %20
%22 = tail call double @llvm.fmuladd.f64(double %13, double %15, double %21)
%23 = fmul double %11, %22
br label %24
24: ; preds = %9, %6
%25 = phi double [ %8, %6 ], [ %23, %9 ]
ret double %25
}