also this solution still uses the exact value "x^x" which is the searched value; as we dont know it first, we can pass it as a second parameter y to function f
So to get the value it's a bit more complex:
function f(x,y)return(x*math.log2 x div 512)*y, y end
(54 bytes)
and to get the value just call "f f f f f f(x 3)" where we provide the initial approximation
And do we need the explicit "return" statement, can't the function use recursive call to itself, something like:
function g(x,y)(x*math.log2 x
div 512)*y,y end
function f(x)g g g g g x,3 end
and get result with just "f x"
(untested, I've probably oversimplified the dependancies, but I must not be very far from the final solution, may be we can drop the second parameter by assuming oit is in a global constant, by transforming a bit the formula inside g)
Now we also need to "optimize" the code size for "math.log2" and the constant "512".
That's where the global constant C=15.5 may play a role, allowing us to use the standard log function (but its name may also be in a global to avoid access to "math.").
The bit fiddling used may also be implemented using the "%2" (modulo 2) operator instead (to replace the initial "and 1 or 2" condition which just needs 1 bit of precision to test if we pass the lower bound or the upper bound of the new approximation when comparing to the value 1024)
There are several tracks to analyse.