News for hackers. Stuff that matters.
Re:Show HN: Matrix Multiplication with Half the Multiplications by abetusk on Friday March 15, 2024 @02:29PM (#39719086)
I'm no expert but I suspect this is wrong. To me, this is like saying you don't need to worry about integer overflow because your operations are only working on fixed integers. Really? You don't care if you multiply or add two large numbers and they spill over?

The more appropriate answer, I suspect, is that the numerical precision and stability sacrifices are more than adequate for normal usage.

If I'm wrong about this, I would certainly like to know.

Re:Show HN: Matrix Multiplication with Half the Multiplications by pclmulqdq on Friday March 15, 2024 @02:47PM (#39719274)
In hardware, you control your integer widths completely, so if you add two 32-bit ints to a 33-bit int, there is no chance of overflow. The same goes for multiplications, etc.
Re:Show HN: Matrix Multiplication with Half the Multiplications by SJC_Hacker on Monday March 18, 2024 @01:03AM (#39740664)
Yeah with shifts you can guarantee no overflow, but you have to decide under what circumstances is avoiding overflow/clipping worth the loss of precision.

Fixed point typically requires alot more programming, but sometimes its worth it if you know what the data ranges are.