I evaluated $\frac{1}{\sqrt{2}}$ and $\frac{\sqrt{2}}{2}$ in Matlab, and got a slight difference: $0.707106781186547$ and $0.707106781186548$, respectively. Which is more accurate, the one with the denominator rationalized, or the one without it rationalized?
2026-03-27 00:02:53.1774569773
On
Does rationalizing the denominator lead to more or less round-off error?
91 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
1
On
With e.g. IEEE floating point numbers, computing the square root and computing the reciprocal are two steps that can introduce rounding error. Division by $2$, however is an exact operation. Therefore, the second can be expected to be slightly less accurate (though of course the errors might even partially cancel) and computing $\sqrt{0.5}$ should produce exactly the same result with the same error as the second expression.
In this case, the value is $0.707106781186547524400844362104849039284835937688474036588339...$, so the second is (marginally) closer. I wouldn't expect there to be a uniform rule on which is more accurate, depending on what expressions you are considering. The point about division by $2$ being exact in computer math does not extend to $\frac 1{\sqrt 3}$ versus $\frac {\sqrt 3}3$, for example.