You cannot use [ ] like that in C code. [ ] is reserved to indicate array elements.
To make your code easier to read and check, you can use intermediate variables, maybe something like this?
double t1 = K+x*B+B;
double v1 = t1 + sqrt(t1^2 - (4*x*B)^2);
y = e2*x*B + 0.5*(e1-e2)* v1;
CP