I am trying to determine some numerical difficulties that arise from a couple problems, and a good way to re-write them to avoid those errors.
For instance, I have:
1) $\sqrt{x+\dfrac{1}{x}} - \sqrt{x-\dfrac{1}{x}}$ where $x\gg 1$
I think that since these two terms approximately equal each other, there will be cancellation error. So I multiplied the numerator and denominator by the conjugate yielding:
$\dfrac{\dfrac{2}{x}}{\sqrt{x+\dfrac{1}{x}}+\sqrt{x-\dfrac{1}{x}}}$
I think that this should get rid of the cancellation error, does anyone see anything wrong with this attempt?
If this looks right, then I will show my attempt on the second problem, but I hope to verify my method first.
2) $\sqrt{\dfrac{1}{a^2}+\dfrac{1}{b^2}}$ where $a\approx 0$ and $b\approx 1$
Thanks!