% Script file: Quad2 % Better form of quadratic equation solutions to % prevent "loss of significance" or "catastrophic cancellation" % % a*x^2 + b*x + c = 0 % a=1, c=1, b=-10^10 root1 = (-b - sign(b)*sqrt(b^2-4*a*c))/2/a root2 = c/a/root1