> If I was given a calculate trial and error would solve it haha.
well, do that. You've got a computer, can easily test a lot of candidates quite easily.
> Hmm, is there a software algorithm that could would literally check every possible value?
not every one
The density property tells us that we can always find another real number that lies between any two real numbers. |
(perhaps if you know that the solution is an integer...)
You work with an approximation and a tolerance.
fun2code shows you a linear search, where you move your candidate according to a delta (refining the delta).
Here you've got other methods
https://en.wikipedia.org/wiki/Root-finding_algorithm
Edit: by looking at your attempts it seems that you've got a conceptual error.
In C++
z = x*log(x) - log(y);
is not an equation, but an statement. It says «assign to `z' the result of the operation on the right», the logs are computed using the
current value of `x' and `y',
It works with numbers, not with expresions, if you later change `x', `z' would remain unaffected.
So
1 2 3 4
|
z2 = pow(x,x);
while (z2 <= y )
{ x+0.1;
}
|
is an infinitie loop, as the condition will never change