For the floating point system $(B, t, L, U) = (10,8,-50,50)$ and for the quadratic equation:
$ax^2 + bx + c$, I need to show error that arises in various cases and how to fix those.
$$a=10^{-30}$$ $$b= -10^{30}$$ $$c=10^{30}$$
I think there is cancellation error when plugging into quadratic formula. Can anyone help me verify that if multiply quadratic formula by conjugate, then I'll get $\frac{2c}{-b \pm \sqrt{b^2-4ac}}$ which will take away the error for the case that is subject to error?
Thanks!
The basic idea is that if |$4ac| \ll b^2$, the square root is very close to $|b|$. Depending on the sign of $b$, one combination or the other will involve subtracting two nearly equal quantities.
To be specific, let us assume $b \gt 0$. Then one root is $\frac {-b+\sqrt{b^2-4ac}}{2a}$ and is the one subject to cancellation. If we multiply by the congugate:$$\frac {-b+\sqrt{b^2-4ac}}{2a}\frac {b+\sqrt{b^2-4ac}}{b+\sqrt{b^2-4ac}}=\frac{b^2-4ac-b^2}{2ab+2a\sqrt{b^2-4ac}}=\frac{-2c}{b+\sqrt{b^2-4ac}}$$ and the cancellation has disappeared. The case $b \lt 0$ is similar except you worry about the one with the minus sign.