void geom_CM_cyl_rpz_B(double xm[], double xp[], double xc[]) {
  xc[0] = 2.0 * (xm[0] * xm[0] + xm[0] * xp[0] + xp[0] * xp[0]) /
          (3.0 * (xm[0] + xp[0]));
  xc[1] = 0.5 * (xm[1] + xp[1]);
}


x86 assembly (clang, -O0):
<geom_CM_cyl_rpz_B>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm2
movsd  0xe94(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm1
movsd  0xe62(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_CM_cyl_rpz_B>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
addsd  %xmm1,%xmm1
mulsd  0xecc(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx)
movsd  0x8(%rdi),%xmm0
addsd  0x8(%rsi),%xmm0
mulsd  0xeba(%rip),%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @geom_CM_cyl_rpz_B(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = fmul double %15, %18
%20 = call double @llvm.fmuladd.f64(double %9, double %12, double %19)
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = call double @llvm.fmuladd.f64(double %23, double %26, double %20)
%28 = fmul double 2.000000e+00, %27
%29 = load double*, double** %4
%30 = getelementptr inbounds double, double* %29, i64 0
%31 = load double, double* %30
%32 = load double*, double** %5
%33 = getelementptr inbounds double, double* %32, i64 0
%34 = load double, double* %33
%35 = fadd double %31, %34
%36 = fmul double 3.000000e+00, %35
%37 = fdiv double %28, %36
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 0
store double %37, double* %39
%40 = load double*, double** %4
%41 = getelementptr inbounds double, double* %40, i64 1
%42 = load double, double* %41
%43 = load double*, double** %5
%44 = getelementptr inbounds double, double* %43, i64 1
%45 = load double, double* %44
%46 = fadd double %42, %45
%47 = fmul double 5.000000e-01, %46
%48 = load double*, double** %6
%49 = getelementptr inbounds double, double* %48, i64 1
store double %47, double* %49
ret void
}

LLVM IR (-O2):
define void @geom_CM_cyl_rpz_B(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fmul double %4, %5
%7 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %6)
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = fmul double %8, 2.000000e+00
%10 = fadd double %4, %5
%11 = fmul double %10, 3.000000e+00
%12 = fdiv double %9, %11
store double %12, double* %2
%13 = getelementptr inbounds double, double* %0, i64 1
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 1
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = fmul double %17, 5.000000e-01
%19 = getelementptr inbounds double, double* %2, i64 1
store double %18, double* %19
ret void
}