%   qform5b.m -- Solve the Quadratic Equation 
%   Written Sep 14, 2005 by Eric Olson for Mathematics 466
%
%   Avoids loss of precision
%
%   For more information see the lecture notes at
%   http://fractal.math.unr.edu/~ejolson/466/notes/lect06.html

function [x1,x2]=qform5b(a,b,c)
    if b>0
        x1=(2*c)/(-b-sqrt(b*b-4*a*c));
        x2=(-b-sqrt(b*b-4*a*c))/(2*a);
    else
        x1=(-b+sqrt(b*b-4*a*c))/(2*a);
        x2=(2*c)/(-b+sqrt(b*b-4*a*c));
    end
