double simplex_J(double *a, double *b, double *c, double *d) {
  double q[9], J;
  q[0] = b[0] - a[0];
  q[1] = c[0] - a[0];
  q[2] = d[0] - a[0];
  q[3] = b[1] - a[1];
  q[4] = c[1] - a[1];
  q[5] = d[1] - a[1];
  q[6] = b[2] - a[2];
  q[7] = c[2] - a[2];
  q[8] = d[2] - a[2];
  J = q[0] * q[4] * q[8] + q[3] * q[7] * q[2] + q[6] * q[1] * q[5] -
      q[6] * q[4] * q[2] - q[0] * q[7] * q[5] - q[3] * q[1] * q[8];
  return J;
}


x86 assembly (clang, -O0):
<simplex_J>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplex_J>:
movsd  (%rsi),%xmm9
movsd  0x8(%rsi),%xmm1
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm6
subsd  %xmm2,%xmm9
movsd  (%rdx),%xmm3
movsd  0x8(%rdx),%xmm8
subsd  %xmm2,%xmm3
movsd  (%rcx),%xmm4
movsd  0x8(%rcx),%xmm5
subsd  %xmm2,%xmm4
subsd  %xmm6,%xmm1
subsd  %xmm6,%xmm8
subsd  %xmm6,%xmm5
movsd  0x10(%rsi),%xmm6
movsd  0x10(%rdi),%xmm0
subsd  %xmm0,%xmm6
movsd  0x10(%rdx),%xmm7
subsd  %xmm0,%xmm7
movsd  0x10(%rcx),%xmm2
subsd  %xmm0,%xmm2
movapd %xmm1,%xmm0
mulsd  %xmm7,%xmm0
mulsd  %xmm9,%xmm7
mulsd  %xmm8,%xmm9
mulsd  %xmm4,%xmm0
mulsd  %xmm2,%xmm9
addsd  %xmm0,%xmm9
mulsd  %xmm3,%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm6,%xmm0
mulsd  %xmm5,%xmm0
addsd  %xmm9,%xmm0
mulsd  %xmm8,%xmm6
mulsd  %xmm4,%xmm6
subsd  %xmm6,%xmm0
mulsd  %xmm5,%xmm7
subsd  %xmm7,%xmm0
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @simplex_J(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca [9 x double]
%10 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load double*, double** %6
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = fsub double %13, %16
%18 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 0
store double %17, double* %18
%19 = load double*, double** %7
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
%25 = fsub double %21, %24
%26 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 1
store double %25, double* %26
%27 = load double*, double** %8
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 0
%32 = load double, double* %31
%33 = fsub double %29, %32
%34 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 2
store double %33, double* %34
%35 = load double*, double** %6
%36 = getelementptr inbounds double, double* %35, i64 1
%37 = load double, double* %36
%38 = load double*, double** %5
%39 = getelementptr inbounds double, double* %38, i64 1
%40 = load double, double* %39
%41 = fsub double %37, %40
%42 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 3
store double %41, double* %42
%43 = load double*, double** %7
%44 = getelementptr inbounds double, double* %43, i64 1
%45 = load double, double* %44
%46 = load double*, double** %5
%47 = getelementptr inbounds double, double* %46, i64 1
%48 = load double, double* %47
%49 = fsub double %45, %48
%50 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 4
store double %49, double* %50
%51 = load double*, double** %8
%52 = getelementptr inbounds double, double* %51, i64 1
%53 = load double, double* %52
%54 = load double*, double** %5
%55 = getelementptr inbounds double, double* %54, i64 1
%56 = load double, double* %55
%57 = fsub double %53, %56
%58 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 5
store double %57, double* %58
%59 = load double*, double** %6
%60 = getelementptr inbounds double, double* %59, i64 2
%61 = load double, double* %60
%62 = load double*, double** %5
%63 = getelementptr inbounds double, double* %62, i64 2
%64 = load double, double* %63
%65 = fsub double %61, %64
%66 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 6
store double %65, double* %66
%67 = load double*, double** %7
%68 = getelementptr inbounds double, double* %67, i64 2
%69 = load double, double* %68
%70 = load double*, double** %5
%71 = getelementptr inbounds double, double* %70, i64 2
%72 = load double, double* %71
%73 = fsub double %69, %72
%74 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 7
store double %73, double* %74
%75 = load double*, double** %8
%76 = getelementptr inbounds double, double* %75, i64 2
%77 = load double, double* %76
%78 = load double*, double** %5
%79 = getelementptr inbounds double, double* %78, i64 2
%80 = load double, double* %79
%81 = fsub double %77, %80
%82 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 8
store double %81, double* %82
%83 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 0
%84 = load double, double* %83
%85 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 4
%86 = load double, double* %85
%87 = fmul double %84, %86
%88 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 8
%89 = load double, double* %88
%90 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 3
%91 = load double, double* %90
%92 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 7
%93 = load double, double* %92
%94 = fmul double %91, %93
%95 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 2
%96 = load double, double* %95
%97 = fmul double %94, %96
%98 = call double @llvm.fmuladd.f64(double %87, double %89, double %97)
%99 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 6
%100 = load double, double* %99
%101 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 1
%102 = load double, double* %101
%103 = fmul double %100, %102
%104 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 5
%105 = load double, double* %104
%106 = call double @llvm.fmuladd.f64(double %103, double %105, double %98)
%107 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 6
%108 = load double, double* %107
%109 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 4
%110 = load double, double* %109
%111 = fmul double %108, %110
%112 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 2
%113 = load double, double* %112
%114 = fneg double %111
%115 = call double @llvm.fmuladd.f64(double %114, double %113, double %106)
%116 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 0
%117 = load double, double* %116
%118 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 7
%119 = load double, double* %118
%120 = fmul double %117, %119
%121 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 5
%122 = load double, double* %121
%123 = fneg double %120
%124 = call double @llvm.fmuladd.f64(double %123, double %122, double %115)
%125 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 3
%126 = load double, double* %125
%127 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 1
%128 = load double, double* %127
%129 = fmul double %126, %128
%130 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 8
%131 = load double, double* %130
%132 = fneg double %129
%133 = call double @llvm.fmuladd.f64(double %132, double %131, double %124)
store double %133, double* %10
%134 = load double, double* %10
ret double %134
}

LLVM IR (-O2):
define double @simplex_J(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
%5 = load double, double* %1
%6 = load double, double* %0
%7 = fsub double %5, %6
%8 = load double, double* %2
%9 = fsub double %8, %6
%10 = load double, double* %3
%11 = fsub double %10, %6
%12 = getelementptr inbounds double, double* %1, i64 1
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %0, i64 1
%15 = load double, double* %14
%16 = fsub double %13, %15
%17 = getelementptr inbounds double, double* %2, i64 1
%18 = load double, double* %17
%19 = fsub double %18, %15
%20 = getelementptr inbounds double, double* %3, i64 1
%21 = load double, double* %20
%22 = fsub double %21, %15
%23 = getelementptr inbounds double, double* %1, i64 2
%24 = load double, double* %23
%25 = getelementptr inbounds double, double* %0, i64 2
%26 = load double, double* %25
%27 = fsub double %24, %26
%28 = getelementptr inbounds double, double* %2, i64 2
%29 = load double, double* %28
%30 = fsub double %29, %26
%31 = getelementptr inbounds double, double* %3, i64 2
%32 = load double, double* %31
%33 = fsub double %32, %26
%34 = fmul double %7, %19
%35 = fmul double %16, %30
%36 = fmul double %11, %35
%37 = tail call double @llvm.fmuladd.f64(double %34, double %33, double %36)
%38 = fmul double %9, %27
%39 = tail call double @llvm.fmuladd.f64(double %38, double %22, double %37)
%40 = fneg double %27
%41 = fmul double %19, %40
%42 = tail call double @llvm.fmuladd.f64(double %41, double %11, double %39)
%43 = fneg double %7
%44 = fmul double %30, %43
%45 = tail call double @llvm.fmuladd.f64(double %44, double %22, double %42)
%46 = fneg double %16
%47 = fmul double %9, %46
%48 = tail call double @llvm.fmuladd.f64(double %47, double %33, double %45)
ret double %48
}