Natural Log function ln(x)

Hi,

Has anyone been able to generate a function for the natual logarithm (ie: log base ‘e’) ???
I’ve looked through the RAPID reference maula and the only function that closely relates is the exponential function.

Is there a way to generate it?
If not, an approximation?

Regards,
bigM

Well, after some investigation I have generated this so far.

The natural log can be approximated by the equation

Letting
z = rac{1+x}{1-x}
and thus
x = rac{z-1}{z+1}
, we get

![\ln z = 2 \left ( \frac{z-1}{z+1} + \frac{1}{3}{\left(\frac{z-1}{z+1}\right)}^3 + \frac{1}{5}{\left(\frac{z-1}{z+1}\right)}^5 + \cdots \right ).](http://upload.wikimedia.org/math/6/b/0/6b05eb2167fb761f5e0e9312ac44ca36.png)
I've converted this into a RAPID function.In order to get the accuracy i require I've gone to the 1999th degree.

Here it is…

FUNC num Ln (num z)
VAR num x;
VAR num answer;
!
answer:=0;
x:=((z-1)/(z+1));
!
FOR i from 1 TO 1999 STEP 2 DO
answer:= answer + (2*(POW(x,i)/i));
ENDFOR
!
RETURN (answer);
ENDFUNC

This approximation should be sufficient, are there any other suggestions?

Regards,
bigM