anchor.diff:  
   As side products of this function, it also gives you optimized version of calculating determinant and adjugate of 4x4 matrix. There are two things I want to talk a little bit more.
   
  -When we calculate the determinants of sub matrices, I do have a version to calculate 4 determinant in one go. However calculate them separately and use _mm_set1_ps to load into vector unit is proven to be faster on my CPU. My guess is since we need them to be separated anyway, even if I can calculate them together I need to use 4 shuffles to separate them out, which is not worth the effort, but I’m not sure. You should test performance in both version.
  +When we calculate the determinants of sub matrices, I do have a version to calculate 4 determinants in one go. However calculate them separately and use _mm_set1_ps to load into vector unit is proven to be faster on my CPU. My guess is since we need them to be separated anyway, even if I can calculate them together I need to use 4 shuffles to separate them out, which is not worth the effort, but I’m not sure. You should test performance in both versions.
   
   Also when calculating trace, I’m using two _mm_hadd_ps to sum up 4 components and have the result in all 4 components. There are a lot of ways to do the same thing. From what I tested, they yield similar performance, so I choose the one with less instructions. Again it could be different on different target platforms, and you should test them. 
   
   So how our functions perform? The following measurement and comparison is done in August 2017. We use __rdtsc to count cycles. For each test we loop 10 million times and measure the average cycle counts. We do 5 groups of tests and here is the result on Intel Haswell:
   
  -.Figure 2
  -image::https://github.com/lxjk/lxjk.github.io/raw/master/images/matrixinverse/fig1.png[, 600,align="center"]
  +.Figure 1
  +image::https://github.com/lxjk/lxjk.github.io/raw/master/images/matrixinverse/fig1.jpg[, 600,align="center"]
   
   The first three columns are our 3 versions of functions. The SIMD version of general 4x4 matrix inverse only cost less than half (44%) of the float version. And if you know the matrix is a transform matrix, it would cost less than a quarter (21%) of the float version. The more information you have as a programmer, the less work the machine need to do.
   
  
positive.code: }
  ----
  
  Another trick is after we calculate the 2x2 sub matrix, for example stem:[\left|D\right|A-B(D^{\#}C)], The final adjugate to get stem:[X=(\left|D\right|A-B(D^{\#}C))^{\#}] can be combined with storing 2x2 sub matrices to the final result 4x4 matrix. You can see this at the end of the function.
  
  The only thing left if determinant. 2x2 determinant is easy, the problem really the whole 4x4 matrix determinant. Remember the determinant property we give above:
  
  [stem]
  ++++
  
negative.code: \vec{P'}=P_0a\vec{X}+P_1b\vec{Y}+P_2c\vec{Z}+\vec{T}
  ++++
  
  This is the same as extend stem:[\vec{P}] to a 4 component vector stem:[\vec{P}(P_0,P_1,P_2,1)] and multiply by matrix stem:[M]. Now what does inverse matrix stem:[M^{-1}] mean? In this case it represents a world to local transform, so if we multiply stem:[\vec{P'}] by stem:[M^{-1}], we should get stem:[\vec{P}] back. How do we transform the point stem:[\vec{P'}] from world space back in local space? We subtract the local space origin (aka the translation stem:[\vec{T}]), then dot each axes to get its local space coordinate and rescale it:
  
  [stem]
  ++++
  