Well, you will have a Taylor series that can be rewritten for better convergence

To convert this good equality into an algorithm, you must understand how convergent series work: each member is smaller and smaller. This decrease is fast enough, so the total is the final value: ln (y).
Due to the good properties of real numbers, you can consider a sequence converging to ln (y):
- L (1) = 2/1 * (y-1) / (y + 1)
- L (2) = 2/1 * (y-1) / (y + 1) + 2/3 * ((y-1) / (y + 1)) ^ 3
- L (3) = 2/1 * (y-1) / (y + 1) + 2/3 * ((y-1) / (y + 1)) ^ 3 + 2/5 * ((y-1 ) / (y + 1)) ^ 5
.. etc.
Obviously, the algorithm for calculating this sequence is simple:
x = (y-1)/(y+1);
z = x * x;
L = 0;
k = 0;
for(k=1; x > epsilon; k+=2)
{
L += 2 * x / k;
x *= z;
}
- x , L, . , .
, 1e ^ -20, epsilon , .
, . , , ln (aยฒ) = 2 ln (a)
, , (y-1)/(y + 1) , , y (, 1, , ).