Why is this such a large value? If I leave your code as is, then the condition for
is never true so the bisection method doesn't do anything. Try reducing err to somethig much smaller (perhaps 0000477) and then the code will iterate 12 times and give you an answer of 49.732039 which f(49.732039) ~= 0. Same with
Why such a large number? Shouldn't this be close to zero too?