If I understand this correctly, x1=(3*a^2)/(8*a^2)+c/a;
//"(+-)" means "plus or minus"
if !x2 then
//Too long. You get the general idea.
Alternatively there are a variety of root-finding algorithms for n-th order polynomials -- bisection method, secant method, newton-rhapson method, etc, all of which are explained in detail in Wikipedia.
Do you want to approximate the roots (numerically) or do you want to solve the equation (algebraically)? (The latter is still possible, since the degree isn't 5 or above, in which case you'd be out of luck...)
I am sorry, I did not check the forum for a month due to examinations! I still have this work pending.
I need to implement a program which is very fast to solve this equation. So I guess an approximated value would also do! I cannot afford to use programs which runs iterations 1000 times to get the corrrect value. Speed of calculation is of utmost importance.