It doesn't check whether the matrix is invertible (and will divide by zero like a retard if it isn't.) I can't actually be arsed to walk through it and see if it's using the proper indices, but I also would not be surprised if it mixed up row- and column-major across different functions.
All of those.
It's also a nightmare to read. Maybe it's more performant to unroll the loop, but any modern compiler is going to unroll/vectorize the loop for you.
You'd be surprised how inconsistent compilers are.
4x4 matrix multiply and inverse is as simple as it gets. It's high school-level math and freshman-level C. No scary pointers or memory management, no libc, no crazy algorithms or data structures. You just write down math operations in sequence. That's it. And AI, supposedly PhD-level, can't even do that.
Here's the thing. You know what's useful? A calculator. You ask it 4 * 4, it says 16. That's useful. Sure, I can do it too, just as fast. But not when it's 32738 * 32758, a calculator is faster. That's useful. And it can do it consistently, without me needing to double check it. That's useful. Can AI?
As you can see, it can't even handle the programming equivalent of 4 * 4. But even if it could - now with Prof-level intelligence, I guess - can it do it consistently?
Even if it messes up just 1 in 100 times, I still have to check every single output by hand. As demonstrated by the responses to my post, checking trivial math in trivial C isn't trivial - and you can't be asked.
If AI works for YOU, great. Honestly, I'm happy for you. But please stop forcing AI into every programming segment. It's not a calculator - well maybe a Pentium one at best.
(It's wrong, but it's fast.)
Too many people think that if you reject AI, you've got a chip on your shoulder. I'd gladly become an Islamic goat herder instead of dealing with modern tech. Might even get some ass, instead of spending my life in front of a computer. Can AI just get a move on already?