One more one more thing.
The math library is a NIF. It does a lot of matrix math and that warranted being a NIF.