function y=quadraticFormula0(a,b,c)
% Roots of a quadratic equation:
% STRAIGHTFORWARD usage of the quadratic formula
% NO attention is paid to minimize rooundoff error,
% overflow and unnecessary underflow.
% The coefficients must all be real.
% However the roots may be complex.
% K. Ming Leung, 01/09/03
if (a~=0)
d=b*b-4*a*c;
a2=2*a;
if (d>0) %
both roots are real
ds=sqrt(d);
x1=(-b+ds)/a2;
x2=-(b+ds)/a2;
elseif (d<0) % pair of complex roots
ds=sqrt(-d);
r1=-b/a2;
r2=ds/a2;
x1=r1+i*r2;
x2=conj(x1);
else
x1=-b/a2; x2=x1;
end;
else
% for a=0
x1=-c/b; x2=Inf;
end
y=[x1 x2];