I'm missing a hint, why you assume that the answer is wrong. All we see is some code and the answers it gives. But we cannot guess what answer you expect.
It is strange that you hard code the function inside the bisection code. In addition you update xR in each iteration - to the same value, but the bisection means, that you update the upper and lower limits.
In addition you compare the function values at xR and xL at first and update xR on demand. Then you check the values at xR and xU. So you have 2 iterations per loop. Look at a defintion of the bisection method either in the script of your lesson or ask wikipedia. One comparison per loop iteration should be enough. If the sign change is not inside the interval [xL xR] it must be inside [xR xU]. Then update the lower or upper limit accordingly by xL=xR or xU=xR until the distance of xU and xL are below the limit.
