double Mfunc3D(double x, double y, double z, double mxy, double mxz,
               double gamma, double h) {
  return mxy * (y - x) + mxz * (z - x) +
         gamma * 2 * (h + (1. - 2 * h) * x) * x * (1. - x);
}


x86 assembly (clang, -O0):
<Mfunc3D>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm3
subsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xeaf(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
addsd  %xmm4,%xmm4
movsd  0xe8c(%rip),%xmm2
subsd  %xmm4,%xmm2
movsd  -0x8(%rbp),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe6a(%rip),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mfunc3D>:
subsd  %xmm0,%xmm1
subsd  %xmm0,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
addsd  %xmm5,%xmm5
movapd %xmm6,%xmm3
addsd  %xmm6,%xmm3
movsd  0xed8(%rip),%xmm2
movapd %xmm2,%xmm4
subsd  %xmm3,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm6,%xmm4
mulsd  %xmm5,%xmm4
mulsd  %xmm0,%xmm4
subsd  %xmm0,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @Mfunc3D(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%15 = load double, double* %11
%16 = load double, double* %9
%17 = load double, double* %8
%18 = fsub double %16, %17
%19 = load double, double* %12
%20 = load double, double* %10
%21 = load double, double* %8
%22 = fsub double %20, %21
%23 = fmul double %19, %22
%24 = call double @llvm.fmuladd.f64(double %15, double %18, double %23)
%25 = load double, double* %13
%26 = fmul double %25, 2.000000e+00
%27 = load double, double* %14
%28 = load double, double* %14
%29 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %28, double 1.000000e+00)
%30 = load double, double* %8
%31 = call double @llvm.fmuladd.f64(double %29, double %30, double %27)
%32 = fmul double %26, %31
%33 = load double, double* %8
%34 = fmul double %32, %33
%35 = load double, double* %8
%36 = fsub double 1.000000e+00, %35
%37 = call double @llvm.fmuladd.f64(double %34, double %36, double %24)
ret double %37
}

LLVM IR (-O2):
define double @Mfunc3D(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fsub double %1, %0
%9 = fsub double %2, %0
%10 = fmul double %9, %4
%11 = tail call double @llvm.fmuladd.f64(double %3, double %8, double %10)
%12 = fmul double %5, 2.000000e+00
%13 = tail call double @llvm.fmuladd.f64(double %6, double -2.000000e+00, double 1.000000e+00)
%14 = tail call double @llvm.fmuladd.f64(double %13, double %0, double %6)
%15 = fmul double %12, %14
%16 = fmul double %15, %0
%17 = fsub double 1.000000e+00, %0
%18 = tail call double @llvm.fmuladd.f64(double %16, double %17, double %11)
ret double %18
}