I was trying to find best 'u' value for this approximation:
$\log_2(x+1)≈x+u$
And I did think I can calculate error with this function.
NOTE: for the x values between 0 and 1 i need becouse of IEEE 754 float point uses a scientific notation that (1 + x) * 2^n that 0 <= x < 1
$f(u)=\int_{0}^{1}|\log_2(x+1)-(x+u)|dx$
Then I wanted to find when the slope becomes zero. (means local min in this situation)
$\frac{d}{du}f(u)=0$
$\frac{d}{du}(\int_{0}^{1}|\log_2(x+1)-(x+u)|dx)=0$
Then I get stuck what can I even do after that?


Firstly I am answering my own question after 2 days because I found a very cool solution for finding the best 'u' value in this approximation:
My solution starts with finding the error value with an integral
Then I split the integral into 2 parts because taking absolute value of error creates a non-continuous function
In this part, we will need to cheat a little and use the graphs. :D
We see that our error function has two roots which means we have 3 parts
2 negative and 1 positive part we can see that
I tried to find the roots of our function, but it only can be calculated with Lambert W function which I can't find how to calculate.
But then I remembered our function is perfect for using Newton's Method For using Newton's Method we need to find the derivative of our error function.
We can start our newton approximation from 0 for $x_0$ and 1 for $x_1$
Proof: (You can skip this part)
and
End of Proof
Let's use Newton's Method:
We need to take integral of $∫_{0}^{E}f_{error}(x,u)dx$ which $f_{tErrPlus}(u,0,E)$
I will skip how we take integral because I think everybody knows.
And after that, it is just a calculation
AND when we calculate all of that (I did) it gives us 0.0644 is the best value for 'u'.