I have a function that is like:
f(x) = c - x^2 (c = some constant positive integer, x = +ve integer >= 0)
The output of this function, goes from positive to negative as x -> +infinity.
Is there a way to directly figure out the
xwhich produces last of the positive outputs before entering in the negative domain?
Also, if I use an iterative method to locate such a point, how should I find the right increment to go with so that I can reach that value of
xas quick as possible? Right now, I am initializing
x = floor(sqrt(c) * 0.9)and using dumb
xto reach the point where
f(x)enters the negative range.
f(x)seems to behave in a weird way for
c > 10e40(i.e. when we initiate
x = floor(sqrt(c) * 0.9)it gives out a value way too far from the desired point) and you can imagine how long the +1 increment takes to get to the desired output with such large values of
Please help. thanks.