3 ms·
also worth noting that you can ask the fpu to trap to catch some types of precision loss or fp underflows.
by a-dub 5y ago
also worth noting that you can ask the fpu to trap to catch some types of precision loss or fp underflows.
- bayindirh 5y agoIf you're playing around subnormal numbers [0], most modern processors automatically switch to a microcode based calculation mode to preserve these numbers. However, these algorithms are very expensive, so it's not desired unless explicitly needed and generally used as an escape hatch for edge cases. [0]: https://en.wikipedia.org/wiki/Subnormal_number https://en.wikipedia.org/wiki/Subnormal_number
- mochomocha 5y agoRight, it's a very slow bandaid. If you're reaching subnormal numbers, it's usually a sign you're doing something wrong.
- a-dub 5y agoi'd be curious what matlab would do with finding the eigs for op's matrix. i'd bet a coffee that it (one of the eigs functions) prints a warning. entirely possible it may even switch search methods if precision loss is detected.
- mattkrause 5y agoI get the same results as the author if I pass the matrix to eig (R2020a, Intel Mac) >> lesp = gallery('lesp', 100) >> any(imag(eig(lesp))) ans = logical 0 >> any(imag(eig(lesp'))) ans = logical 1
- a-dub 5y agowhat about eigs() with the 'Display' option turned on?
- mattkrause 5y agoNo luck there either, I'm afraid. It sets 'flag' to zero (i.e., converged), but A and A^T still differ.