Honestly I didn't read much of what people said, I just read part of your first post, BUT
there is something I'd like to say

since sqrt(bval*bval - 4*aval*cval))/(2*aval) is needed to find x AND...