LAPACK is the underlying library behind most linear algebra packages in other languages and furthermore it was just an example. My guess is that you probably don’t have just one line of matrix manipulation ever, in which case using a well established library is a good idea. If not, then sure. Do it yourself. But that’s still more code that you have to maintain now.
That's arguable, because 10 lines of code almost never just stays 10 lines of code, and my point in the first place was more contesting that the dependency is hard to choose, or that there aren't solid proven libraries for this.
1 large, complex dependency (plus the 20 lines of wrapper code to transform your program's internal data to initialise and call the library) almost never just stays as 1 large, complex dependency (plus 20 lines of ...).
If you're truly just doing a 2x2 matrix manipulation once in the codebase, then I concede. I guess I'm blanking on situations where that would be the case though, or where more generalized capabilities wouldn't be useful.
But I was really just wanting to show, via irony, that the structure of the original argument is self-annihilating.
That is, "X almost never stays as just X therefore X is bad" applies to both branches reasonably, and is therefore invalid as an argument in support of one branch.
This is why it's important to add a comment to those 10 lines describing the choice, and urging future contributors to reevaluate the situation.
(Of course, one should always reevaluate the situation when making changes to code, but we all need a nudge sometimes when we're afraid of doing the wrong thing.)
The difference between those two things is often blurry from a distance. Business logic is algorithmic too, it's just a question of how specific and complex the algorithm is.
Business logic changes and grows more complex over time, how to invert a matrix doesn't. Trust me, I implement algorithms for a large library for a living, they very rarely change or grow.