These algorithms' design starts on paper, as pure maths. You get the analytic form, and convert this to numerical/discrete form and start to design from there.
You need to add normalization, subnormal number prevention, maybe some architecture specific optimization if you are targeting a specific CPU generation, etc. Then it gets optimized further as you run tests, profile the code and run your test cases.
So, no BLAS package looks the same, because they make different trade-offs, have different programming models, and handle things differently, at different points. Even more so, a newer generation processor with much higher FPU performance can have lower performance than previous generation, so you implement another copy of that function or add to detect that processor and have different paths just for that one.
IOW, when doing numerical maths on processors, esp. if you're doing this on many machines with MPI or multiple cores with hand rolled code or OpenMP, there's no single way. Maybe a best way for the specific CPU you have, but it still depends on the trade-offs and design choices you made in the very beginning.
The design of those macros is more art than science.
This is a sparse matrix library, IIRC. Numerical linear algebra and applications using it are black art at this point. I have written a Boundary Element Method evaluator for my Ph.D., and know what it entails to work with these things.
Doing fast operations on sparse matrices is a cutthroat race and when you can shave your hot path by seconds, your solution can save hours in some cases. So, it's an interesting niche. i.e.: It's no ordinary boilerplate.
While I worked with dense matrices; the effect, difficulty, blood sweat and tears are still there.
When a model can give back your hard work back to you with a "completion" without attribution, that's bad.
[0]: https://x.com/docsparse/status/1581461734665367554