All you have to do is change the value of fVal and evaluate the expression again, over and over, and it will be like plugging in an testing each point as you want.
The expression and the values will change with every user. I will test x*x*x-x-2 with 1 and 2, but another user will test (x-1)(x-2) with -3 and 3, another user will test it with whatever crazy formula he thinks...
Yes, I try other formulas myself, but muparser doesn't like parenthesis, and even if you don't use parenthesis in your formula, the results of the bisection method are not accurate.
For example. x*x*x-x-2 using 1 and 2, should give a root of 1.52138, instead I got a root of 2.
Now, looking more closely to the results I see:
#
Iteration A B C f(c)
1 1.5 2 1.5 1.5
2 1.75 2 1.75 1.75
3 1.875 2 1.875 1.875
The right results should be:
#
Iteracion A B C f(c)
1 1.5 2 1.5 -0.125
2 1.5 1.75 1.75 1.60938
3 1.5 1.625 1.625 0.666016
In second iteration something happens and B don't change, I don't see why.